qemu-e2k/hw
Peter Maydell 9a09273f33 hw/dma/xlnx_csu_dma: Set TYPE_XLNX_CSU_DMA class_size
In commit 00f05c02f9 we gave the TYPE_XLNX_CSU_DMA object its
own class struct, but forgot to update the TypeInfo::class_size
accordingly.  This meant that not enough memory was allocated for the
class struct, and the initialization of xcdc->read in the class init
function wrote off the end of the memory. Add the missing line.

Found by running 'check-qtest-aarch64' with a clang
address-sanitizer build, which complains:

==2542634==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61000000ab00 at pc 0x559a20aebc29 bp 0x7fff97df74d0 sp 0x7fff97df74c8
WRITE of size 8 at 0x61000000ab00 thread T0
    #0 0x559a20aebc28 in xlnx_csu_dma_class_init /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../hw/dma/xlnx_csu_dma.c:722:16
    #1 0x559a21bf297c in type_initialize /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../qom/object.c:365:9
    #2 0x559a21bf3442 in object_class_foreach_tramp /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../qom/object.c:1070:5
    #3 0x7f09bcb641b7 in g_hash_table_foreach (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x401b7)
    #4 0x559a21bf3c27 in object_class_foreach /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../qom/object.c:1092:5
    #5 0x559a21bf3c27 in object_class_get_list /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../qom/object.c:1149:5
    #6 0x559a2081a2fd in select_machine /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../softmmu/vl.c:1661:24
    #7 0x559a2081a2fd in qemu_create_machine /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../softmmu/vl.c:2146:35
    #8 0x559a2081a2fd in qemu_init /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../softmmu/vl.c:3706:5
    #9 0x559a20720ed5 in main /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../softmmu/main.c:49:5
    #10 0x7f09baec00b2 in __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:308:16
    #11 0x559a2067673d in _start (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/qemu-system-aarch64+0xf4b73d)

0x61000000ab00 is located 0 bytes to the right of 192-byte region [0x61000000aa40,0x61000000ab00)
allocated by thread T0 here:
    #0 0x559a206eeff2 in calloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/qemu-system-aarch64+0xfc3ff2)
    #1 0x7f09bcb7bef0 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x57ef0)
    #2 0x559a21bf3442 in object_class_foreach_tramp /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/san/../../qom/object.c:1070:5

Fixes: 00f05c02f9 ("hw/dma/xlnx_csu_dma: Support starting a read transfer through a class method")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Francisco Iglesias <francisco.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20220308150207.2546272-1-peter.maydell@linaro.org
2022-03-18 10:55:15 +00:00
..
9pfs 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() 2022-03-07 11:49:31 +01:00
acpi hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table 2022-03-06 16:06:16 -05:00
adc
alpha
arm I²C / SMBus / PMBus patches 2022-03-09 21:16:27 +00:00
audio hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
avr
block aspeed queue: 2022-03-09 18:06:40 +00:00
char hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
core clock-vmstate: Add missing END_OF_LIST 2022-03-02 18:12:40 +00:00
cpu
cris
display macfb: set initial value of mode control registers in macfb_common_realize() 2022-03-09 09:29:10 +00:00
dma hw/dma/xlnx_csu_dma: Set TYPE_XLNX_CSU_DMA class_size 2022-03-18 10:55:15 +00:00
gpio hw: aspeed_gpio: Cleanup stray semicolon after switch 2022-03-08 09:18:11 +01:00
hppa hppa: Add support for an emulated TOC/NMI button. 2022-02-02 18:46:42 +01:00
hyperv
i2c hw/i2c: Added linear mode translation for pmbus devices 2022-03-08 18:46:48 +01:00
i386 hw/acpi/microvm: turn on 8042 bit in FADT boot architecture flags if present 2022-03-07 17:43:14 -05:00
ide MIPS patches queue 2022-03-09 09:13:39 +00:00
input hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
intc ppc/xive2: Make type Xive2EndSource not user creatable 2022-03-14 15:57:17 +01:00
ipack
ipmi hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
isa hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
m68k mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs 2022-03-09 09:28:28 +00:00
mem Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
microblaze
mips hw/mips/gt64xxx_pci: Resolve gt64120_register() 2022-03-08 19:38:13 +01:00
misc kvm/msi: do explicit commit when adding msi routes 2022-03-15 11:26:20 +01:00
net virtio-net: fix map leaking on error during receive 2022-03-15 13:57:44 +08:00
nios2
nubus
nvme hw/nvme: 64-bit pi support 2022-03-03 09:30:21 +01:00
nvram hw/nvram: at24 return 0xff if 1 byte address 2022-03-14 14:48:35 +01:00
openrisc hw/openrisc/openrisc_sim: Add support for initrd loading 2022-02-26 10:39:36 +09:00
pci acpi: pcihp: pcie: set power on cap on parent slot 2022-03-06 05:08:23 -05:00
pci-bridge pci: expose TYPE_XIO3130_DOWNSTREAM name 2022-03-06 05:08:23 -05:00
pci-host ppc/pnv: Remove user-created PHB{3,4,5} devices 2022-03-14 15:57:17 +01:00
pcmcia
ppc ppc/pnv: Remove user-created PHB{3,4,5} devices 2022-03-14 15:57:17 +01:00
rdma hw/dma: Use dma_addr_t type definition when relevant 2022-01-18 12:56:29 +01:00
remote hw/remote: Add missing include 2022-02-21 10:18:06 +01:00
riscv hw: riscv: opentitan: fixup SPI addresses 2022-03-03 13:14:50 +10:00
rtc hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
rx
s390x s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z15 GA1 2022-02-28 11:29:15 +01:00
scsi esp: recreate ESPState current_req after migration 2022-03-09 09:29:10 +00:00
sd Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
sensor hw/sensor: add Renesas raa228000 device 2022-03-08 18:46:48 +01:00
sh4
smbios hw/smbios: Add table 4 parameter, "processor-id" 2022-03-06 05:28:55 -05:00
sparc
sparc64
ssi aspeed/smc: Fix error log 2022-03-08 09:18:11 +01:00
timer hw/timer: fix a9gtimer vmstate 2022-02-21 13:30:21 +00:00
tpm MIPS patches queue 2022-03-09 09:13:39 +00:00
tricore
usb hw/usb/redirect.c: Stop using qemu_oom_check() 2022-03-04 11:20:16 +01:00
vfio kvm/msi: do explicit commit when adding msi routes 2022-03-15 11:26:20 +01:00
virtio * whpx fixes in preparation for GDB support (Ivan) 2022-03-15 14:41:16 +00:00
watchdog
xen aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
xenpv
xtensa
Kconfig
meson.build