qemu-e2k/hw
Greg Kurz 9c6b899f7a 9pfs: local: set the path of the export root to "."
The local backend was recently converted to using "at*()" syscalls in order
to ensure all accesses happen below the shared directory. This requires that
we only pass relative paths, otherwise the dirfd argument to the "at*()"
syscalls is ignored and the path is treated as an absolute path in the host.
This is actually the case for paths in all fids, with the notable exception
of the root fid, whose path is "/". This causes the following backend ops to
act on the "/" directory of the host instead of the virtfs shared directory
when the export root is involved:
- lstat
- chmod
- chown
- utimensat

ie, chmod /9p_mount_point in the guest will be converted to chmod / in the
host for example. This could cause security issues with a privileged QEMU.

All "*at()" syscalls are being passed an open file descriptor. In the case
of the export root, this file descriptor points to the path in the host that
was passed to -fsdev.

The fix is thus as simple as changing the path of the export root fid to be
"." instead of "/".

This is CVE-2017-7471.

Cc: qemu-stable@nongnu.org
Reported-by: Léo Gaspard <leo@gaspard.io>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-04-18 14:01:43 +01:00
..
9pfs 9pfs: local: set the path of the export root to "." 2017-04-18 14:01:43 +01:00
acpi tco: do not generate an NMI 2017-04-05 17:23:52 +02:00
adc
alpha
arm
audio
block xen: do not build backends for targets that do not support xen 2017-03-19 11:12:12 +01:00
bt
char xen: do not build backends for targets that do not support xen 2017-03-19 11:12:12 +01:00
core block: add missed aio_context_acquire into release_drive 2017-04-03 17:11:39 +02:00
cpu
cris
display qxl: add migration blocker to avoid pre-save assert 2017-04-11 08:38:17 +02:00
dma dma/rc4030: fix a mixed declarations and code warning 2017-03-20 11:20:35 +00:00
gpio
i2c
i386 trace: Avoid abuse of amdvi_mmio_read 2017-03-24 09:21:42 +00:00
ide ide: ahci: call cleanup function in ahci unit 2017-03-15 20:50:14 -04:00
input virtio-input: fix eventq batching 2017-03-27 12:14:45 +02:00
intc hw/intc/arm_gicv3_kvm: Check KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS in reset 2017-03-31 12:41:14 +01:00
ipack
ipmi ipmi: Fix macro issues 2017-04-02 21:17:47 +02:00
isa tco: do not generate an NMI 2017-04-05 17:23:52 +02:00
lm32
m68k
mem
microblaze
mips
misc
moxie
net e1000: disable debug by default 2017-03-31 08:48:13 +08:00
nios2 nios2: iic: Convert CPU prop to qom link 2017-03-18 18:22:54 +00:00
nvram
openrisc
pci pci: Only unmap bus_master_enabled_region if was added previously 2017-04-04 18:32:25 +03:00
pci-bridge
pci-host
pcmcia
ppc pseries: Enforce homogeneous threads-per-core 2017-04-03 13:46:18 +10:00
s390x s390x/css: reassign subchannel if schid is changed after migration 2017-03-20 09:22:57 +01:00
scsi * MTTCG fix for win32 2017-03-27 17:34:50 +01:00
sd
sh4
smbios
sparc
sparc64
ssi
timer
tpm
tricore
unicore32
usb usb-host: switch to LIBUSB_API_VERSION 2017-04-03 14:41:23 +01:00
vfio vfio/pci-quirks: Exclude non-ioport BAR from NVIDIA quirk 2017-04-06 16:03:26 -06:00
virtio vhost: generalize iommu memory region 2017-03-30 19:09:16 +03:00
watchdog
xen xen: do not build backends for targets that do not support xen 2017-03-19 11:12:12 +01:00
xenpv
xtensa
Makefile.objs