On Wed, 22 Nov 2000 23:12:25 +0000 (GMT), 
Russell King <[EMAIL PROTECTED]> wrote:
>        if (copy_from_user(mod+1, mod_user+1, mod->size-sizeof(*mod))) {

Using sizeof(struct module) is a nono in sys_init_module(), the code
has to use the user space size.  Does this untested patch fix the
problem?  Against 2.4.0-test11-pre6 but should fit test11.


Index: 0-test11-pre6.1/kernel/module.c
--- 0-test11-pre6.1/kernel/module.c Wed, 08 Nov 2000 11:52:15 +1100 kaos 
(linux-2.4/j/28_module.c 1.1.2.1.1.1.7.1.1.1 644)
+++ 0-test11-pre6.1(w)/kernel/module.c Thu, 23 Nov 2000 10:22:26 +1100 kaos 
+(linux-2.4/j/28_module.c 1.1.2.1.1.1.7.1.1.1 644)
@@ -480,7 +480,9 @@ sys_init_module(const char *name_user, s
 
        /* Ok, that's about all the sanity we can stomach; copy the rest.  */
 
-       if (copy_from_user(mod+1, mod_user+1, mod->size-sizeof(*mod))) {
+       if (copy_from_user((char *)mod+mod_user_size,
+                          (char *)mod_user+mod_user_size,
+                          mod->size-mod_user_size)) {
                error = -EFAULT;
                goto err3;
        }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to