lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m1bqafk8xg.fsf@ebiederm.dsl.xmission.com>
Date:	Wed, 31 Oct 2007 02:03:23 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	benh@...nel.crashing.org
Cc:	Joel Becker <Joel.Becker@...cle.com>,
	Linux Netdev <netdev@...r.kernel.org>,
	Linux Kernel Mailing List <Linux-Kernel@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>
Subject: Re: dev_ifname32() fails on 32->64bit calls in copy_in_user().

Benjamin Herrenschmidt <benh@...nel.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@...nel.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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ