xemu/hw
Li Qiang ba42ebb863 9pfs: allocate space for guest originated empty strings
If a guest sends an empty string paramater to any 9P operation, the current
code unmarshals it into a V9fsString equal to { .size = 0, .data = NULL }.

This is unfortunate because it can cause NULL pointer dereference to happen
at various locations in the 9pfs code. And we don't want to check str->data
everywhere we pass it to strcmp() or any other function which expects a
dereferenceable pointer.

This patch enforces the allocation of genuine C empty strings instead, so
callers don't have to bother.

Out of all v9fs_iov_vunmarshal() users, only v9fs_xattrwalk() checks if
the returned string is empty. It now uses v9fs_string_size() since
name.data cannot be NULL anymore.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
[groug, rewritten title and changelog,
 fix empty string check in v9fs_xattrwalk()]
Signed-off-by: Greg Kurz <groug@kaod.org>
2016-10-17 14:13:58 +02:00
..
9pfs 9pfs: allocate space for guest originated empty strings 2016-10-17 14:13:58 +02:00
acpi acpi: provide _PXM method for CPU devices if QEMU is started numa enabled 2016-10-10 01:16:57 +03:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
arm virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
audio pcspk: adding vmstate for save/restore 2016-09-15 15:10:06 +02:00
block virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
bt bt-hci-csr: drop unused argument 2016-10-08 09:02:19 +03:00
char virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
core generic-loader: Add a generic loader 2016-10-04 13:28:09 +01:00
cpu
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
dma hw/dma: vmstateify rc4030 2016-09-29 12:07:51 +01:00
gpio
i2c i2c: fix migration regression introduced by broadcast support 2016-08-03 18:44:56 +02:00
i386 virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
ide Block layer patches 2016-10-04 14:25:08 +01:00
input virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
intc * Thread Sanitizer fixes (Alex) 2016-10-10 10:39:29 +01:00
ipack
ipmi vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
isa portio: keep references on portio 2016-09-08 18:05:21 +04:00
lm32 Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
m68k m68k: change default system clock for m5208evb 2016-10-08 11:25:29 +03:00
mem trace: move hw/mem/pc-dimm.c trace points into correct file 2016-09-28 19:17:54 +01:00
microblaze Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
mips error: Strip trailing '\n' from error string arguments (again) 2016-08-08 09:00:44 +02:00
misc hw/misc/edu: support MSI interrupt 2016-10-04 10:00:25 +02:00
moxie
net virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
nvram vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
openrisc
pci trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
pci-bridge hw/pci-bridge: Convert pxb initialization functions to Error 2016-07-29 00:07:09 +03:00
pci-host apb: convert init to realize 2016-07-29 00:07:09 +03:00
pcmcia
ppc numa: reduce code duplication by adding helper numa_get_node_for_cpu() 2016-10-10 01:16:57 +03:00
s390x s390x/css: {c,h,t,r,x}sch: require enable AND device number valid 2016-09-28 13:24:51 +02:00
scsi virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
sd vmstateify ssi-sd 2016-09-22 18:13:08 +01:00
sh4 sh4: fix broken link to documentation 2016-09-15 15:32:22 +03:00
smbios smbios: fix uuid copy 2016-09-29 11:43:22 +08:00
sparc intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface 2016-10-04 10:00:25 +02:00
sparc64
ssi STM32F2xx: Add the SPI device 2016-10-04 13:28:07 +01:00
timer * Thread Sanitizer fixes (Alex) 2016-10-10 10:39:29 +01:00
tpm Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
tricore tricore: remove useless cast 2016-09-15 15:32:22 +03:00
unicore32
usb usb-redir: allocate buffers before waking up the host adapter 2016-10-12 14:37:24 +02:00
vfio memory: introduce IOMMUNotifier and its caps 2016-09-27 08:59:16 +02:00
virtio virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
watchdog
xen Xen: fix converity warning of xen_pt_config_init() 2016-08-12 16:38:18 -07:00
xenpv xenpv: Fix qemu_uuid compiling error 2016-09-29 11:43:17 +08:00
xtensa target-xtensa: xtfpga: fix FLASH interface width 2016-07-14 13:59:44 +03:00
Makefile.objs STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00