qemu-e2k/hw/9pfs
Daniel P. Berrange 8af0020544 hw/9pfs: Fix errno value for xattr functions
If there is no operation driver for the xattr type the
functions return '-1' and set errno to '-EOPNOTSUPP'.
When the calling code sets 'ret = -errno' this turns
into a large positive number.

In Linux 3.11, the kernel has switched to using 9p
version 9p2000.L, instead of 9p2000.u, which enables
support for xattr operations. This on its own is harmless,
but for another change which makes it request the xattr
with a name 'security.capability'.

The result is that the guest sees a succesful return
of 95 bytes of data, instead of a failure with errno
set to 95. Since the kernel expects a maximum of 20
bytes for an xattr return this gets translated to the
unexpected errno ERANGE.

This all means that when running a binary off a 9p fs
in 3.11 kernels you get a fun result of:

  # ./date
  sh: ./date: Numerical result out of range

The only workaround is to pass 'version=9p2000.u' when
mounting the 9p fs in the guest, to disable all use of
xattrs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-10-05 13:05:28 +04:00
..
codir.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
cofile.c hw/9pfs: Be robust against paths without FS_IOC_GETVERSION 2013-05-28 15:23:12 +05:30
cofs.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
coxattr.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
Makefile.objs Remove libhw 2012-10-05 16:07:49 -05:00
virtio-9p-coth.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
virtio-9p-coth.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
virtio-9p-device.c virtio-9p-device: Avoid freeing uninitialized memory 2013-08-01 11:18:24 -05:00
virtio-9p-handle.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
virtio-9p-local.c hw/9pfs: Use O_NOFOLLOW when opening files on server 2013-05-28 15:23:12 +05:30
virtio-9p-posix-acl.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
virtio-9p-proxy.c hw/9pfs: Fix potential memory leak and avoid reuse of freed memory 2013-07-27 11:22:54 +04:00
virtio-9p-proxy.h hw/9pfs: Proxy getversion 2012-01-04 20:20:55 +05:30
virtio-9p-synth.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
virtio-9p-synth.h janitor: add guards to headers 2012-12-19 08:31:31 +01:00
virtio-9p-xattr-user.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
virtio-9p-xattr.c hw/9pfs: Fix errno value for xattr functions 2013-10-05 13:05:28 +04:00
virtio-9p-xattr.h misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
virtio-9p.c hw/9pfs: Fix segfault with 9p2000.u 2013-05-28 15:23:12 +05:30
virtio-9p.h virtio-9p: cleanup: QOM casts. 2013-04-23 10:37:49 -05:00