From: ebiederm@xmission.com (Eric W. Biederman)
To: benh@kernel.crashing.org
Cc: Joel Becker <Joel.Becker@oracle.com>,
Linux Netdev <netdev@vger.kernel.org>,
Linux Kernel Mailing List <Linux-Kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: dev_ifname32() fails on 32->64bit calls in copy_in_user().
Date: Wed, 31 Oct 2007 02:03:23 -0600 [thread overview]
Message-ID: <m1bqafk8xg.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <1193798124.9928.91.camel@pasglop> (Benjamin Herrenschmidt's message of "Wed, 31 Oct 2007 13:35:24 +1100")
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> Bug is in the new dev_ifname32:
>
> uifr = compat_alloc_user_space(sizeof(struct ifreq));
> if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
> return -EFAULT;
>
> There's a stray ";" after the if statement, that was obviously not
> tested :-)
Grr sorry about that, and thanks for catching this.
Eric
> This fixes it here (tested):
> ----------------------------------------------------------------------------
> [PATCH] Fix new dev_ifname32 returning -EFAULT
>
> A stray semicolon slipped in the patch that updated dev_ifname32 to
> not be inline, causing it to always return -EFAULT. This fixes it.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Index: linux-work/fs/compat_ioctl.c
> ===================================================================
> --- linux-work.orig/fs/compat_ioctl.c 2007-10-31 13:30:42.000000000 +1100
> +++ linux-work/fs/compat_ioctl.c 2007-10-31 13:30:46.000000000 +1100
> @@ -322,7 +322,7 @@ static int dev_ifname32(unsigned int fd,
> int err;
>
> uifr = compat_alloc_user_space(sizeof(struct ifreq));
> - if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
> + if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)))
> return -EFAULT;
>
> err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr);
prev parent reply other threads:[~2007-10-31 8:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 0:38 Joel Becker
2007-10-31 1:06 ` Benjamin Herrenschmidt
2007-10-31 1:12 ` Arnd Bergmann
2007-10-31 2:35 ` Benjamin Herrenschmidt
2007-10-31 3:41 ` David Miller
2007-10-31 8:03 ` Eric W. Biederman [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=m1bqafk8xg.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=Joel.Becker@oracle.com \
--cc=Linux-Kernel@vger.kernel.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=netdev@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®