mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: kaos@ocs.com.au (Keith Owens)
Cc: linux-kernel@vger.kernel.org
Subject: Re: Modutils 2.3.14 / Kernel 2.4.0-test11 incompatibility
Date: Thu, 23 Nov 2000 00:06:34 +0000 (GMT)	[thread overview]
Message-ID: <200011230006.AAA02777@raistlin.arm.linux.org.uk> (raw)
In-Reply-To: <4589.974935487@ocs3.ocs-net> from "Keith Owens" at Nov 23, 2000 10:24:47 AM

Keith Owens writes:
> On Wed, 22 Nov 2000 23:12:25 +0000 (GMT), 
> Russell King <rmk@arm.linux.org.uk> 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;
>  	}

This also works!
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |         Russell King        rmk@arm.linux.org.uk      --- ---
  | | | | http://www.arm.linux.org.uk/personal/aboutme.html   /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

      reply	other threads:[~2000-11-23  0:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-22 23:12 Russell King
2000-11-22 23:24 ` Keith Owens
2000-11-23  0:06   ` Russell King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200011230006.AAA02777@raistlin.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®