All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Joel Becker <Joel.Becker@oracle.com>
Cc: Linux Netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <Linux-Kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: dev_ifname32() fails on 32->64bit calls in copy_in_user().
Date: Wed, 31 Oct 2007 13:35:24 +1100	[thread overview]
Message-ID: <1193798124.9928.91.camel@pasglop> (raw)
In-Reply-To: <20071031003850.GE7517@tasint.org>

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 :-)

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);



  parent reply	other threads:[~2007-10-31  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  0:38 dev_ifname32() fails on 32->64bit calls in copy_in_user() Joel Becker
2007-10-31  1:06 ` Benjamin Herrenschmidt
2007-10-31  1:12 ` Arnd Bergmann
2007-10-31  2:35 ` Benjamin Herrenschmidt [this message]
2007-10-31  3:41   ` David Miller
2007-10-31  8:03   ` Eric W. Biederman

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=1193798124.9928.91.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=Joel.Becker@oracle.com \
    --cc=Linux-Kernel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.