Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23474
b: refs/heads/master
c: 24277dd
h: refs/heads/master
v: v3
  • Loading branch information
Davi Arnaut authored and Linus Torvalds committed Mar 24, 2006
1 parent 29a367a commit 2d5fc37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96840aa00a031069a136ec4c55d0bdd09ac6d3a7
refs/heads/master: 24277dda3a54aa5e6265487e1a3091e27f3c0c45
19 changes: 3 additions & 16 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,6 @@ static struct module *load_module(void __user *umod,
exportindex, modindex, obsparmindex, infoindex, gplindex,
crcindex, gplcrcindex, versindex, pcpuindex, gplfutureindex,
gplfuturecrcindex;
long arglen;
struct module *mod;
long err = 0;
void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
Expand Down Expand Up @@ -1691,23 +1690,11 @@ static struct module *load_module(void __user *umod,
}

/* Now copy in args */
arglen = strlen_user(uargs);
if (!arglen) {
err = -EFAULT;
goto free_hdr;
}
args = kmalloc(arglen, GFP_KERNEL);
if (!args) {
err = -ENOMEM;
args = strndup_user(uargs, ~0UL >> 1);
if (IS_ERR(args)) {
err = PTR_ERR(args);
goto free_hdr;
}
if (copy_from_user(args, uargs, arglen) != 0) {
err = -EFAULT;
goto free_mod;
}

/* Userspace could have altered the string after the strlen_user() */
args[arglen - 1] = '\0';

if (find_module(mod->name)) {
err = -EEXIST;
Expand Down

0 comments on commit 2d5fc37

Please sign in to comment.