qemu-e2k/hw
Greg Kurz 16724a1730 9p: init_in_iov_from_pdu can truncate the size
init_in_iov_from_pdu might not be able to allocate the full buffer size
requested, which comes from the client and could be larger than the
transport has available at the time of the request. Specifically, this
can happen with read operations, with the client requesting a read up to
the max allowed, which might be more than the transport has available at
the time.

Today the implementation of init_in_iov_from_pdu throws an error, both
Xen and Virtio.

Instead, change the V9fsTransport interface so that the size becomes a
pointer and can be limited by the implementation of
init_in_iov_from_pdu.

Change both the Xen and Virtio implementations to set the size to the
size of the buffer they managed to allocate, instead of throwing an
error. However, if the allocated buffer size is less than P9_IOHDRSZ
(the size of the header) still throw an error as the case is unhandable.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
CC: groug@kaod.org
CC: anthony.perard@citrix.com
CC: roman@zededa.com
CC: qemu_oss@crudebyte.com
[groug: fix 32-bit build]
Signed-off-by: Greg Kurz <groug@kaod.org>
2020-01-20 15:11:39 +01:00
..
9pfs 9p: init_in_iov_from_pdu can truncate the size 2020-01-20 15:11:39 +01:00
acpi hmat acpi: Build Memory Side Cache Information Structure(s) 2020-01-05 07:03:03 -05:00
adc Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
alpha hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
arm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
audio hda-codec: fix recording rate control 2020-01-06 08:47:16 +01:00
block * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
bt Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
char * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
core migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
cpu hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cris cris: improve passing PIC interrupt vector to the CPU 2020-01-07 17:24:29 +04:00
display migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
dma lance: replace PROP_PTR with PROP_LINK 2020-01-07 17:24:29 +04:00
gpio omap-gpio: remove PROP_PTR 2020-01-07 17:24:29 +04:00
hppa hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
hyperv hyperv: Use auto rcu_read macros 2019-12-17 19:33:52 +01:00
i2c migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
i386 * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
ide vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
input migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
intc apic: Use 32bit APIC ID for migration instance ID 2020-01-20 09:10:23 +01:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
isa hw/isa/isa-bus: cleanup irq functions 2019-12-17 19:33:51 +01:00
lm32 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
m68k Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
mem memory-device: Fix memory pre-plug error API violations 2019-12-18 08:36:15 +01:00
microblaze microblaze: fix leak of fdevice tree blob 2019-10-04 18:49:16 +02:00
mips * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
misc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
pci-bridge numa: move numa global variable nb_numa_nodes into MachineState 2019-09-03 11:26:55 -03:00
pci-host hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge 2019-12-18 02:34:12 +01:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
rdma hw/rdma: Utilize ibv_reg_mr_iova for memory registration 2019-11-06 12:49:04 +02:00
riscv chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
rtc hw/rtc/mc146818: Add missing dependency on ISA Bus 2020-01-07 12:23:10 +01:00
s390x vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
scsi * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
sd hw/sd: drop extra whitespace in sdhci_sysbus_realize() header 2019-12-18 08:43:19 +01:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04:00
smbios smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00
sparc * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
sparc64 hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
ssi aspeed/smc: Add AST2600 timings registers 2019-12-16 10:46:34 +00:00
timer migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tpm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tricore Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
usb usb: bugfixes for xhci, usb pass-through and usb redirection. 2020-01-13 14:19:57 +00:00
vfio vfio/pci: Don't remove irqchip notifier if not registered 2020-01-06 14:19:42 -07:00
virtio virtio: reset region cache when on queue deletion 2020-01-06 12:04:51 -05:00
watchdog aspeed: Change the "scu" property definition 2019-12-16 10:46:34 +00:00
xen xen: convert "-machine igd-passthru" to an accelerator property 2019-12-17 19:32:27 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa hw/xtensa: add virt machine 2019-10-18 20:38:10 -07:00
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00