]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/module.c
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / kernel / module.c
index e4276046a1b62489b9b4e60362119ad95656e438..5aad477ddc79c94567c02e9ee704f1eb71fa1b66 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/syscalls.h>
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
+#include <linux/capability.h>
 #include <linux/cpu.h>
 #include <linux/moduleparam.h>
 #include <linux/errno.h>
@@ -1669,6 +1670,9 @@ static struct module *load_module(void __user *umod,
                goto free_mod;
        }
 
+       /* Userspace could have altered the string after the strlen_user() */
+       args[arglen - 1] = '\0';
+
        if (find_module(mod->name)) {
                err = -EEXIST;
                goto free_mod;
@@ -2091,7 +2095,8 @@ static unsigned long mod_find_symname(struct module *mod, const char *name)
        unsigned int i;
 
        for (i = 0; i < mod->num_symtab; i++)
-               if (strcmp(name, mod->strtab+mod->symtab[i].st_name) == 0)
+               if (strcmp(name, mod->strtab+mod->symtab[i].st_name) == 0 &&
+                   mod->symtab[i].st_info != 'U')
                        return mod->symtab[i].st_value;
        return 0;
 }