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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090831182754.GA3620@infradead.org>
Date:	Mon, 31 Aug 2009 14:27:54 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	Torsten Kaiser <just.for.lkml@...glemail.com>
Cc:	Christoph Hellwig <hch@...radead.org>,
	Michael Tokarev <mjt@....msk.ru>,
	Linux-kernel <linux-kernel@...r.kernel.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>, xfs@....sgi.com
Subject: Re: xfs compat_ioctl?

On Mon, Aug 31, 2009 at 08:14:58PM +0200, Torsten Kaiser wrote:
> On a slightly related note: I also have a system with a 32bit userland
> and a 64bit kernel.
> After switching to the 64bit kernel, xfs_fsr was no longer working,
> but that was caused by the then still missing compat ioctls.
> 
> Today I retried it, but it still fails:
> XFS_IOC_SWAPEXT failed: ino=<number>: Invalid argument
> 
> Looking at the compat code SWAPEXT looks somewhat suspicious:
> 
> fs/xfs/linux-2.6/xfs_ioctl32.h defines XFS_IOC_SWAPEXT_32, but I can't
> find a single place where this is used.
> And in the big switch of xfs_compat_ioctl() the value XFS_IOC_SWAPEXT
> is surrounded by contants that all end in 32.
> 
> I don't have any experience with the linux ioctl code, I only read
> fs/xfs/linux-2.6/xfs_ioctl32.c, but for my untrained eye it looks like
> there is a _32 missing.
> 
> Or am I misreading this completely?

I think you are right, the constant used is incorrect.  Does the small
patch below fix it for you?

Index: linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_ioctl32.c	2009-08-31 15:25:06.093044591 -0300
+++ linux-2.6/fs/xfs/linux-2.6/xfs_ioctl32.c	2009-08-31 15:25:10.856544216 -0300
@@ -619,7 +619,7 @@ xfs_file_compat_ioctl(
 	case XFS_IOC_GETVERSION_32:
 		cmd = _NATIVE_IOC(cmd, long);
 		return xfs_file_ioctl(filp, cmd, p);
-	case XFS_IOC_SWAPEXT: {
+	case XFS_IOC_SWAPEXT_32: {
 		struct xfs_swapext	  sxp;
 		struct compat_xfs_swapext __user *sxu = arg;
 
--
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