Debian Bug report logs - #755738
qemu-system-x86 - 9p support does not translate d_type in readdir

version graph

Package: qemu-system-x86; Maintainer for qemu-system-x86 is Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>; Source for qemu-system-x86 is src:qemu (PTS, buildd, popcon).

Reported by: Bastian Blank <waldi@debian.org>

Date: Tue, 22 Jul 2014 21:15:11 UTC

Severity: important

Tags: confirmed, patch, upstream

Found in version qemu/2.0.0+dfsg-6

Fixed in version qemu/2.1+dfsg-4

Done: Michael Tokarev <mjt@tls.msk.ru>

Bug is archived. No further changes may be made.

Forwarded to http://thread.gmane.org/gmane.comp.emulators.qemu/290700

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Tue, 22 Jul 2014 21:15:16 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
New Bug report received and forwarded. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Tue, 22 Jul 2014 21:15:16 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Bastian Blank <waldi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: qemu-system-x86 - 9p support does not translate d_type in readdir
Date: Tue, 22 Jul 2014 23:11:18 +0200
Package: qemu-system-x86
Version: 2.0.0+dfsg-6+b1
Severity: important

The local 9p support supports readdir.  It does not translate the value
of d_type, so the guest always sees a regular file, even in a lstat call
describes it correctly as symlink.

Responsible for reading the info on the host is
hw/9pfs/virtio-9p-local.c#local_readdir_r.  It could just return
DT_UNKNOWN in either of the mapped cases.

This completely breaks ldconfig for example, so it is not usable to run
a real system.

Bastian

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages qemu-system-x86 depends on:
ii  ipxe-qemu           1.0.0+git-20131111.c3d1e78-2
ii  libaio1             0.3.109-4
ii  libasound2          1.0.28-1
ii  libbluetooth3       4.101-4.1
ii  libbrlapi0.6        5.0-2+b1
ii  libc6               2.19-7
ii  libcurl3-gnutls     7.37.0-1+b1
ii  libfdt1             1.4.0+dfsg-1
ii  libgcc1             1:4.9.0-7
ii  libglib2.0-0        2.40.0-3
ii  libgnutls-deb0-28   3.2.15-3
ii  libiscsi2           1.11.0-4
ii  libjpeg8            8d1-1
ii  libncurses5         5.9+20140118-1
ii  libpixman-1-0       0.32.6-1
ii  libpng12-0          1.2.50-1
ii  libpulse0           5.0-2
ii  librados2           0.80.1-2
ii  librbd1             0.80.1-2
ii  libsasl2-2          2.1.26.dfsg1-11
ii  libsdl1.2debian     1.2.15-10
ii  libseccomp2         2.1.1-1
ii  libspice-server1    0.12.5-1
ii  libssh2-1           1.4.3-3
ii  libtinfo5           5.9+20140118-1
ii  libusb-1.0-0        2:1.0.19-1
ii  libusbredirparser1  0.7-1
ii  libuuid1            2.20.1-5.8
ii  libvdeplug2         2.3.2-4
ii  libx11-6            2:1.6.2-2
ii  libxen-4.3          4.3.0-3+b1
ii  libxenstore3.0      4.3.0-3+b1
ii  qemu-keymaps        2.0.0+dfsg-6
ii  qemu-system-common  2.0.0+dfsg-6+b1
ii  seabios             1.7.5-1
ii  zlib1g              1:1.2.8.dfsg-1

Versions of packages qemu-system-x86 recommends:
ii  qemu-utils  2.0.0+dfsg-6+b1

Versions of packages qemu-system-x86 suggests:
ii  kmod     18-1
pn  ovmf     <none>
pn  samba    <none>
pn  sgabios  <none>
pn  vde2     <none>

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Thu, 24 Jul 2014 14:51:11 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Thu, 24 Jul 2014 14:51:11 GMT) (full text, mbox, link).


Message #10 received at 755738@bugs.debian.org (full text, mbox, reply):

From: Bastian Blank <waldi@debian.org>
To: 755738@bugs.debian.org
Subject: Re: Bug#755738: Acknowledgement (qemu-system-x86 - 9p support does not translate d_type in readdir)
Date: Thu, 24 Jul 2014 14:46:38 +0000
[Message part 1 (text/plain, inline)]
Control: tag -1 patch

Patch is attached.

Bastian
[9p-readdir (text/plain, attachment)]

Added tag(s) patch. Request was from Bastian Blank <waldi@debian.org> to 755738-submit@bugs.debian.org. (Thu, 24 Jul 2014 14:51:11 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 13:42:05 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Tokarev <mjt@tls.msk.ru>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 13:42:05 GMT) (full text, mbox, link).


Message #17 received at submit@bugs.debian.org (full text, mbox, reply):

From: Michael Tokarev <mjt@tls.msk.ru>
To: Bastian Blank <waldi@debian.org>, 755738@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#755738: qemu-system-x86 - 9p support does not translate d_type in readdir
Date: Wed, 30 Jul 2014 17:39:41 +0400
Control: tag -1 + moreinfo

23.07.2014 01:11, Bastian Blank wrote:
> Package: qemu-system-x86
> Version: 2.0.0+dfsg-6+b1
> Severity: important
> 
> The local 9p support supports readdir.  It does not translate the value
> of d_type, so the guest always sees a regular file, even in a lstat call
> describes it correctly as symlink.

I'm not sure what do you mean by "translate".  It passes d_type from host.
And it works in guest as is.  Including ldconfig and other stuff.  In
particular, d_type is 8 for regular files in guest, 10 for symlinks and
4 for directories.

> Responsible for reading the info on the host is
> hw/9pfs/virtio-9p-local.c#local_readdir_r.  It could just return
> DT_UNKNOWN in either of the mapped cases.
> 
> This completely breaks ldconfig for example, so it is not usable to run
> a real system.

ldconfig works here just fine here.

Thanks,

/mjt



Added tag(s) moreinfo. Request was from Michael Tokarev <mjt@tls.msk.ru> to submit@bugs.debian.org. (Wed, 30 Jul 2014 13:42:05 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 13:42:09 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Tokarev <mjt@tls.msk.ru>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 13:42:09 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 19:33:04 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 19:33:05 GMT) (full text, mbox, link).


Message #29 received at submit@bugs.debian.org (full text, mbox, reply):

From: Bastian Blank <waldi@debian.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: 755738@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#755738: qemu-system-x86 - 9p support does not translate d_type in readdir
Date: Wed, 30 Jul 2014 21:29:08 +0200
On Wed, Jul 30, 2014 at 05:39:41PM +0400, Michael Tokarev wrote:
> 23.07.2014 01:11, Bastian Blank wrote:
> > The local 9p support supports readdir.  It does not translate the value
> > of d_type, so the guest always sees a regular file, even in a lstat call
> > describes it correctly as symlink.
> I'm not sure what do you mean by "translate".  It passes d_type from host.
> And it works in guest as is.  Including ldconfig and other stuff.  In
> particular, d_type is 8 for regular files in guest, 10 for symlinks and
> 4 for directories.

The 9p host code uses extended attributes to save the type:

| $ stat ld-linux-x86-64.so.2 
|   File: ‘ld-linux-x86-64.so.2’
|   Size: 32              Blocks: 8          IO Block: 4096   regular file
| Device: 33h/51d Inode: 84315       Links: 1
| Access: (0600/-rw-------)  Uid: ( 1000/ bastian)   Gid: ( 1000/ bastian)
[...]
| $ getfattr -d -e hex ld-linux-x86-64.so.2
| # file: ld-linux-x86-64.so.2
| user.virtfs.gid=0x00000000
| user.virtfs.mode=0xffa10000
| user.virtfs.uid=0x00000000
| $ hexdump -C ld-linux-x86-64.so.2 
| 00000000  2f 6c 69 62 2f 78 38 36  5f 36 34 2d 6c 69 6e 75  |/lib/x86_64-linu|
| 00000010  78 2d 67 6e 75 2f 6c 64  2d 32 2e 31 39 2e 73 6f  |x-gnu/ld-2.19.so|

There is nothing in the host readdir implementation that handles this
extra type information.

Bastian

-- 
The sight of death frightens them [Earthers].
		-- Kras the Klingon, "Friday's Child", stardate 3497.2



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 19:33:08 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 19:33:08 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 19:36:09 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Tokarev <mjt@tls.msk.ru>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 19:36:09 GMT) (full text, mbox, link).


Message #39 received at 755738@bugs.debian.org (full text, mbox, reply):

From: Michael Tokarev <mjt@tls.msk.ru>
To: Bastian Blank <waldi@debian.org>
Cc: 755738@bugs.debian.org
Subject: Re: Bug#755738: qemu-system-x86 - 9p support does not translate d_type in readdir
Date: Wed, 30 Jul 2014 23:33:38 +0400
30.07.2014 23:29, Bastian Blank wrote:
> On Wed, Jul 30, 2014 at 05:39:41PM +0400, Michael Tokarev wrote:
>> 23.07.2014 01:11, Bastian Blank wrote:

>> I'm not sure what do you mean by "translate".  It passes d_type from host.
>> And it works in guest as is.  Including ldconfig and other stuff.  In
>> particular, d_type is 8 for regular files in guest, 10 for symlinks and
>> 4 for directories.
> 
> The 9p host code uses extended attributes to save the type:
> 
> | $ stat ld-linux-x86-64.so.2 
> |   File: ‘ld-linux-x86-64.so.2’
> |   Size: 32              Blocks: 8          IO Block: 4096   regular file
> | Device: 33h/51d Inode: 84315       Links: 1
> | Access: (0600/-rw-------)  Uid: ( 1000/ bastian)   Gid: ( 1000/ bastian)
> [...]
> | $ getfattr -d -e hex ld-linux-x86-64.so.2
> | # file: ld-linux-x86-64.so.2
> | user.virtfs.gid=0x00000000
> | user.virtfs.mode=0xffa10000
> | user.virtfs.uid=0x00000000
> | $ hexdump -C ld-linux-x86-64.so.2 
> | 00000000  2f 6c 69 62 2f 78 38 36  5f 36 34 2d 6c 69 6e 75  |/lib/x86_64-linu|
> | 00000010  78 2d 67 6e 75 2f 6c 64  2d 32 2e 31 39 2e 73 6f  |x-gnu/ld-2.19.so|
> 
> There is nothing in the host readdir implementation that handles this
> extra type information.

Um.

So are you having probs with these files on host or in guest?
Can you maybe provide steps to reproduce a problem?

What I did is this: I exported a /tmp like this:

 -fsdev local,security_model=passthrough,id=fsdev0,path=/tmp \
 -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare

and mounted this share in guest using -o trans=virtio.  In that mountpoint
in guest, I ran some tests to see how various file types are represented.
And found out that it all works correctly, at least with symlinks (which
are represented as symlinks on both host and guest) and block special
files.  I haven't created files in guest, all files where created on
host.  This all works correctly, at least seemingly.

Thanks,

/mjt



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 19:45:05 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 19:45:05 GMT) (full text, mbox, link).


Message #44 received at submit@bugs.debian.org (full text, mbox, reply):

From: Bastian Blank <waldi@debian.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: 755738@bugs.debian.org, Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#755738: qemu-system-x86 - 9p support does not translate d_type in readdir
Date: Wed, 30 Jul 2014 21:41:45 +0200
Command line:

qemu-system-x86_64 
 -machine q35,accel=kvm 
 -m 2048 -smp 2,cores=2 
 -serial stdio -k de
 -usbdevice tablet 
 -vga qxl -spice addr=127.0.0.1,port=5900,disable-ticketing
 -kernel /boot/vmlinuz-3.14-1-amd64 -initrd initramfs-3.14-1-amd64
 -append 'root=root rw rootfstype=9p rootflags=trans=virtio,version=9p2000.L console=ttyS0'
 -virtfs local,path=sid,mount_tag=root,security_model=mapped-xattr
 -net user -net nic,model=virtio

-- 
... The prejudices people feel about each other disappear when they get
to know each other.
		-- Kirk, "Elaan of Troyius", stardate 4372.5



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#755738; Package qemu-system-x86. (Wed, 30 Jul 2014 19:45:08 GMT) (full text, mbox, link).


Acknowledgement sent to Bastian Blank <waldi@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 30 Jul 2014 19:45:08 GMT) (full text, mbox, link).


Added tag(s) upstream and confirmed. Request was from <mjt@tls.msk.ru> to control@bugs.debian.org. (Wed, 13 Aug 2014 19:51:15 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'http://thread.gmane.org/gmane.comp.emulators.qemu/290700'. Request was from <mjt@tls.msk.ru> to control@bugs.debian.org. (Wed, 13 Aug 2014 19:51:19 GMT) (full text, mbox, link).


Removed tag(s) moreinfo. Request was from <mjt@tls.msk.ru> to control@bugs.debian.org. (Thu, 21 Aug 2014 15:27:08 GMT) (full text, mbox, link).


Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Sun, 31 Aug 2014 05:51:06 GMT) (full text, mbox, link).


Notification sent to Bastian Blank <waldi@debian.org>:
Bug acknowledged by developer. (Sun, 31 Aug 2014 05:51:06 GMT) (full text, mbox, link).


Message #60 received at 755738-close@bugs.debian.org (full text, mbox, reply):

From: Michael Tokarev <mjt@tls.msk.ru>
To: 755738-close@bugs.debian.org
Subject: Bug#755738: fixed in qemu 2.1+dfsg-4
Date: Sun, 31 Aug 2014 05:49:44 +0000
Source: qemu
Source-Version: 2.1+dfsg-4

We believe that the bug you reported is fixed in the latest version of
qemu, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 755738@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Tokarev <mjt@tls.msk.ru> (supplier of updated qemu package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 31 Aug 2014 09:32:59 +0400
Source: qemu
Binary: qemu qemu-system qemu-system-common qemu-system-misc qemu-system-arm qemu-system-mips qemu-system-ppc qemu-system-sparc qemu-system-x86 qemu-user qemu-user-static qemu-user-binfmt qemu-utils qemu-guest-agent qemu-kvm
Architecture: source
Version: 2.1+dfsg-4
Distribution: unstable
Urgency: medium
Maintainer: Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>
Changed-By: Michael Tokarev <mjt@tls.msk.ru>
Description:
 qemu       - fast processor emulator
 qemu-guest-agent - Guest-side qemu-system agent
 qemu-kvm   - QEMU Full virtualization on x86 hardware
 qemu-system - QEMU full system emulation binaries
 qemu-system-arm - QEMU full system emulation binaries (arm)
 qemu-system-common - QEMU full system emulation binaries (common files)
 qemu-system-mips - QEMU full system emulation binaries (mips)
 qemu-system-misc - QEMU full system emulation binaries (miscelaneous)
 qemu-system-ppc - QEMU full system emulation binaries (ppc)
 qemu-system-sparc - QEMU full system emulation binaries (sparc)
 qemu-system-x86 - QEMU full system emulation binaries (x86)
 qemu-user  - QEMU user mode emulation binaries
 qemu-user-binfmt - QEMU user mode binfmt registration for qemu-user
 qemu-user-static - QEMU user mode emulation binaries (static version)
 qemu-utils - QEMU utilities
Closes: 755738 759522
Changes:
 qemu (2.1+dfsg-4) unstable; urgency=medium
 .
   * mention libnuma-dev but not enable for now
   * 9p-readdir.patch: fix readdir in 9p mapped mode (Closes: #755738)
   * pc-reserve-more-memory-for-acpi.patch: fix linux -kernel not working
     with new qemu (Closes: #759522)
   * qemu-options-add-missing--drive-discard-option-to-cmdline-help.diff -
     documentation fix
   * mention that 2.1 closed #754336.
   * move qemu-bridge-helper to /usr/lib/qemu/ subdir (lintian)
   * debian/binfmt-update-in (Serge Hallyn):
     - don't run in a container
     - add ppc64le as target
   * add apport hook from ubuntu package (ubuntu-only for now)
Checksums-Sha1:
 e031f7ff24934ea75a810c59f58f1cc8cdb0e867 5083 qemu_2.1+dfsg-4.dsc
 7ba2afd6f79ce120f747727d7abf3fbb96929a4c 61056 qemu_2.1+dfsg-4.debian.tar.xz
Checksums-Sha256:
 cc2db1935ab59724dce04fedbc94827283a87afc428147fbb8ed6f71805a6e4f 5083 qemu_2.1+dfsg-4.dsc
 70f1386928dd5cf1ce0980d5fea72d38ed07f4e1b6fa7efaac1e4a0cebe2ec84 61056 qemu_2.1+dfsg-4.debian.tar.xz
Files:
 2406e452fd0846977588ea159cca3425 5083 otherosfs optional qemu_2.1+dfsg-4.dsc
 849397ac00dd828f66ef51bb0fb7b6b6 61056 otherosfs optional qemu_2.1+dfsg-4.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUArTaAAoJEL7lnXSkw9fbDCUH/iWecKte+T2jD/XYh2iovXX1
7h3lDYO9+MHWPuRyacHqwh3lvvuJAsHNUqKKc92Q0uPQVvbYl4voZEp0zo27IcJe
RKCGwn9iu9o2QS3bCEsAhYu1WipkInL5O5EpMU73yOApOFInTxXARWDFPDZ0EW6l
no6s3U2D8+wVf8SFhFCLyGaWLVCeKLUKA4ZRzr+a55l2PS4EKTruVX4mJQ0nDcv2
oUXkYffVPyiDGXGTOwaEuAYrVjBvjwE1elSa6F3EKih1mzenkxIcxv8E22cfEtFV
vD4csNnXbaq6nDnuS+BrrC3gyLarFnDwKKKIQBNBTmNo3rc3J5g7E6KmK8Hrxso=
=BBhJ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 04 Oct 2014 07:31:42 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Nov 24 18:20:15 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.