summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-02-07 21:58:45 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-08 01:12:32 +0100
commit8e08b756869eeb08ace17ad64c2a8cb97b18e856 (patch)
treef25b68e82001f1abaa9e9c25e663f8945d37c96d /kernel
parent[PATCH] uml: remove a dead file (diff)
downloadlinux-8e08b756869eeb08ace17ad64c2a8cb97b18e856.tar.xz
linux-8e08b756869eeb08ace17ad64c2a8cb97b18e856.zip
[PATCH] module: strlen_user() race fix
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index e058aedf6b93..5aad477ddc79 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1670,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;