qemu-e2k/hw/usb
Peter Maydell f8324611c1 hw/usb/hcd-xhci: Avoid variable-length array in xhci_get_port_bandwidth()
In xhci_get_port_bandwidth(), we use a variable-length array to
construct the buffer to send back to the guest. Avoid the VLA
by using dma_memory_set() to directly request the memory system
to fill the guest memory with a string of '80's.

The codebase has very few VLAs, and if we can get rid of them all we
can make the compiler error on new additions.  This is a defensive
measure against security bugs where an on-stack dynamic allocation
isn't correctly size-checked (e.g.  CVE-2021-3527).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230824164818.2652452-1-peter.maydell@linaro.org>
2023-08-31 19:47:43 +02:00
..
bus.c
canokey.c hw/usb/canokey: change license to GPLv2+ 2023-07-25 17:24:12 +01:00
canokey.h hw/usb/canokey: change license to GPLv2+ 2023-07-25 17:24:12 +01:00
ccid-card-emulated.c hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
ccid-card-passthru.c
ccid.h
chipidea.c
combined-packet.c
core.c
desc-msos.c
desc.c
desc.h
dev-audio.c
dev-hid.c
dev-hub.c
dev-mtp.c
dev-network.c
dev-serial.c
dev-smartcard-reader.c
dev-storage-bot.c
dev-storage-classic.c
dev-storage.c
dev-uas.c hw: replace most qemu_bh_new calls with qemu_bh_new_guarded 2023-04-28 11:31:54 +02:00
dev-wacom.c
hcd-dwc2.c hw: replace most qemu_bh_new calls with qemu_bh_new_guarded 2023-04-28 11:31:54 +02:00
hcd-dwc2.h
hcd-dwc3.c
hcd-ehci-pci.c hw/usb/hcd-ehci-pci: Simplify using DEVICE_GET_CLASS() macro 2023-06-09 23:38:16 +03:00
hcd-ehci-sysbus.c
hcd-ehci.c hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
hcd-ehci.h
hcd-musb.c
hcd-ohci-pci.c
hcd-ohci.c hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
hcd-ohci.h
hcd-uhci.c hw: replace most qemu_bh_new calls with qemu_bh_new_guarded 2023-04-28 11:31:54 +02:00
hcd-uhci.h
hcd-xhci-nec.c
hcd-xhci-pci.c
hcd-xhci-pci.h
hcd-xhci-sysbus.c
hcd-xhci-sysbus.h
hcd-xhci.c hw/usb/hcd-xhci: Avoid variable-length array in xhci_get_port_bandwidth() 2023-08-31 19:47:43 +02:00
hcd-xhci.h
host-libusb.c hw: replace most qemu_bh_new calls with qemu_bh_new_guarded 2023-04-28 11:31:54 +02:00
host.h
imx-usb-phy.c
Kconfig kconfig: Add PCIe devices to s390x machines 2023-07-14 11:10:57 +02:00
libhw.c
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
pcap.c
quirks-ftdi-ids.h
quirks-pl2303-ids.h
quirks.c
quirks.h hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
redirect.c hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
trace-events hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
trace.h
tusb6010.c
u2f-emulated.c
u2f-passthru.c
u2f.c
u2f.h
vt82c686-uhci-pci.c
xen-usb.c hw/usb: spelling fixes 2023-08-31 19:47:43 +02:00
xlnx-usb-subsystem.c
xlnx-versal-usb2-ctrl-regs.c