summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-02-07 12:58:45 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-07 16:12:32 -0800
commit8e08b756869eeb08ace17ad64c2a8cb97b18e856 (patch)
treef25b68e82001f1abaa9e9c25e663f8945d37c96d /kernel/module.c
parent48b8c10056d22ecc070bbfcbbfc8f84d13181178 (diff)
downloadtalos-op-linux-8e08b756869eeb08ace17ad64c2a8cb97b18e856.tar.gz
talos-op-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/module.c')
-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;
OpenPOWER on IntegriCloud