All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kasper Sandberg <lkml@metanurb.dk>
To: David Howells <dhowells@redhat.com>
Cc: Chuck Ebbert <76306.1226@compuserve.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	ak@muc.de, vojtech@suse.cz
Subject: Re: BUG? atleast >=2.6.19-rc5, x86 chroot on x86_64
Date: Wed, 06 Dec 2006 01:11:29 +0100	[thread overview]
Message-ID: <1165363889.15706.4.camel@localhost> (raw)
In-Reply-To: <4701.1165328393@redhat.com>

On Tue, 2006-12-05 at 14:19 +0000, David Howells wrote:
> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> 
> > Here is a patch to reverse that.  Kasper, can you test it?
> > (Your filesystem is on a FAT/VFAT volume, I assume.)

I do have a fat32 filesystem mounted using the vfat driver (the msdos
one arent compiled in), however the chroot in no way has access to this,
and i dont see how ANY 32bit apps can have attempted to access it, ill
go so far as say im certain they havent.

> 
> Please don't revert that patch.  If you do, you'll break CONFIG_BLOCK=n.
okay, i will not.

> 
> Can you compile and run the attached program as both 32-bit and 64-bit?
Yes, i will conduct tests, however it will have to wait till atleast
tomorow (cant garantuee anything though, i have lots of work to do).
> 
> On my x86_64 test box, I did:
> 
> 	[root@andromeda ~]# mkfs.vfat /dev/sda5
> 	[root@andromeda ~]# mount /dev/sda5 /mnt
> 	[root@andromeda ~]# mkdir /mnt/a
> 	[root@andromeda ~]# /tmp/ioctl /mnt/a		# 32-bit
> 	268 : 82187201, 82187202
> 	268 : 82187201, 82187202
> 	Calling VFAT_IOCTL_READDIR_BOTH32
> 	Calling VFAT_IOCTL_READDIR_BOTH
> 	[root@andromeda ~]# /tmp/ioctl /mnt/a		# 64-bit
> 	280 : 82307201, 82307202
> 	268 : 82187201, 82187202
> 	Calling VFAT_IOCTL_READDIR_BOTH32
> 	ioctl: Inappropriate ioctl for device
> 	Calling VFAT_IOCTL_READDIR_BOTH
> 
> Which is what I'd expect (the 64-bit ioctl does not support the 32-bit
> function).  Tracing the 64-bit version shows that the right numbers are being
> given to the syscall, though strace decodes them as the same symbol if not in
> raw mode:
> 
> 	[root@andromeda ~]# strace -eioctl -eraw=ioctl /tmp/ioctl /mnt/a
> 	280 : 82307201, 82307202
> 	268 : 82187201, 82187202
> 	Calling VFAT_IOCTL_READDIR_BOTH32
> 	ioctl(0x3, 0x82187201, 0x7fff9cec36c0)  = -1 (errno 25)
> 	ioctl: Inappropriate ioctl for device
> 	Calling VFAT_IOCTL_READDIR_BOTH
> 	ioctl(0x3, 0x82307201, 0x7fff9cec3490)  = 0x1
> 	Process 3410 detached
> 
> Applying the attached patch to the kernel produces the following elements in
> the log for the 32-bit compilation:
> 
> 	==> fat_compat_dir_ioctl(82187201,ffa803b8)
> 	==> fat_dir_ioctl(82307201,ffff810036a97ca8)
> 	<== fat_dir_ioctl() = 1
> 	<== fat_compat_dir_ioctl() = 1
> 	==> fat_compat_dir_ioctl(82187201,ffa801a0)
> 	==> fat_dir_ioctl(82307201,ffff810036a97ca8)
> 	<== fat_dir_ioctl() = 1
> 	<== fat_compat_dir_ioctl() = 1
> 
> and this for the 64-bit compilation:
> 
> 	==> fat_dir_ioctl(82187201,7fff031f69f0)
> 	call fat_generic_ioctl()
> 	<== fat_dir_ioctl() = -25
> 	==> fat_dir_ioctl(82307201,7fff031f67c0)
> 	<== fat_dir_ioctl() = 1
> 
> Which is entirely what I'd expect.
> 
> However, it's possible that the 64-bit kernel interface used to allow the
> 32-bit calls.  If that's the case could you be running a 64-bit program
> somewhere in your 32-bit chroot?
I am basically positive that i am not running 64bit stuff within my
32bit chroot, however i will check to make absolutely sure.
> 
> | i have only tested with >=rc5, thw folling, as an example, appears in
> | dmesg:
> | ioctl32(regedit.exe:11801): Unknown cmd fd(9) cmd(82187201){02}
> | arg(00221000) on /home/redeeman
> | ioctl32(regedit.exe:11801): Unknown cmd fd(9) cmd(82187201){02}
> | arg(00221000) on /home/redeeman/.wine/drive_c/windows/system32
> | ioctl32(regedit.exe:11801): Unknown cmd fd(9) cmd(82187201){02}
> | arg(00221000) on /home/redeeman/.wine/drive_c/windows/system
> 
> How do you get that?  I don't see anything like that.  I've tried:
all i did was run wine's regedit inside my 32bit chroot.
> 
> 	echo 1 >/proc/sys/kernel/compat-log
> 
> But that doesn't seem to do anything.
> 
> David
> 


  reply	other threads:[~2006-12-06  0:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-05  9:33 BUG? atleast >=2.6.19-rc5, x86 chroot on x86_64 Chuck Ebbert
2006-12-05 14:19 ` David Howells
2006-12-06  0:11   ` Kasper Sandberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-13  7:50 Chuck Ebbert
2006-12-13  8:05 ` Kasper Sandberg
2006-12-13 11:08 ` Alan
2006-12-11  8:27 Chuck Ebbert
2006-12-13  4:39 ` Kasper Sandberg
2006-12-06  2:31 Chuck Ebbert
2006-12-06 12:58 ` Kasper Sandberg
2006-12-06 13:08   ` David Howells
2006-12-06 16:06     ` Kasper Sandberg
2006-12-06 16:48       ` David Howells
2006-12-06 20:05         ` Kasper Sandberg
2006-12-06 21:29   ` Andi Kleen
2006-12-06 22:19     ` Kasper Sandberg
2006-12-05 20:32 Chuck Ebbert
2006-12-05 22:11 ` David Howells
2006-11-22 14:29 Kasper Sandberg
2006-11-22 23:25 ` Andrew Morton
2006-11-26 13:47   ` Kasper Sandberg
2006-12-05  2:36   ` Kasper Sandberg
2006-12-05  2:59     ` Kasper Sandberg
2006-12-05  3:20     ` Andrew Morton
2006-12-05 14:17       ` David Howells

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=1165363889.15706.4.camel@localhost \
    --to=lkml@metanurb.dk \
    --cc=76306.1226@compuserve.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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.