qemu/hw
Zheyu Ma 36a894aeb6 net: tulip: Restrict DMA engine to memories
The DMA engine is started by I/O access and then itself accesses the
I/O registers, triggering a reentrancy bug.

The following log can reveal it:
==5637==ERROR: AddressSanitizer: stack-overflow
    #0 0x5595435f6078 in tulip_xmit_list_update qemu/hw/net/tulip.c:673
    #1 0x5595435f204a in tulip_write qemu/hw/net/tulip.c:805:13
    #2 0x559544637f86 in memory_region_write_accessor qemu/softmmu/memory.c:492:5
    #3 0x5595446379fa in access_with_adjusted_size qemu/softmmu/memory.c:554:18
    #4 0x5595446372fa in memory_region_dispatch_write qemu/softmmu/memory.c
    #5 0x55954468b74c in flatview_write_continue qemu/softmmu/physmem.c:2825:23
    #6 0x559544683662 in flatview_write qemu/softmmu/physmem.c:2867:12
    #7 0x5595446833f3 in address_space_write qemu/softmmu/physmem.c:2963:18
    #8 0x5595435fb082 in dma_memory_rw_relaxed qemu/include/sysemu/dma.h:87:12
    #9 0x5595435fb082 in dma_memory_rw qemu/include/sysemu/dma.h:130:12
    #10 0x5595435fb082 in dma_memory_write qemu/include/sysemu/dma.h:171:12
    #11 0x5595435fb082 in stl_le_dma qemu/include/sysemu/dma.h:272:1
    #12 0x5595435fb082 in stl_le_pci_dma qemu/include/hw/pci/pci.h:910:1
    #13 0x5595435fb082 in tulip_desc_write qemu/hw/net/tulip.c:101:9
    #14 0x5595435f7e3d in tulip_xmit_list_update qemu/hw/net/tulip.c:706:9
    #15 0x5595435f204a in tulip_write qemu/hw/net/tulip.c:805:13

Fix this bug by restricting the DMA engine to memories regions.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2022-09-02 10:22:39 +08:00
..
9pfs
acpi acpi/nvdimm: Define trace events for NVDIMM and substitute nvdimm_debug() 2022-07-26 10:37:46 -04:00
adc hw/adc: Make adci[*] R/W in NPCM7XX ADC 2022-07-18 13:20:14 +01:00
alpha
arm hw: Add compat machines for 7.2 2022-08-25 21:59:04 +02:00
audio
avr
block virtio-scsi: fix race in virtio_scsi_dataplane_start() 2022-08-17 07:07:37 -04:00
char
core hw: Add compat machines for 7.2 2022-08-25 21:59:04 +02:00
cpu
cris
cxl hw/cxl: Correctly handle variable sized mailbox input payloads. 2022-08-17 13:08:11 -04:00
display xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command 2022-08-08 11:40:06 +02:00
dma
gpio hw/gpio/aspeed: Don't let guests modify input pins 2022-07-14 16:24:38 +02:00
hppa lasips2: remove legacy lasips2_initfn() function 2022-07-18 19:28:46 +01:00
hyperv
i2c hw/i2c/pmbus: Add idle state to return 0xff's 2022-07-14 16:24:38 +02:00
i386 util: accept iova_tree_remove_parameter by value 2022-09-02 10:22:39 +08:00
ide block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
input pckbd: remove legacy i8042_mm_init() function 2022-07-18 19:28:46 +01:00
intc hw/intc/ppc-uic: Convert ppc-uic to a PPC4xx DCR device 2022-08-31 14:08:06 -03:00
ipack
ipmi ipmi:smbus: Add a check around a memcpy 2022-08-01 06:40:50 -05:00
isa
loongarch hw/loongarch: remove acpi-build.c unused variable 'aml_len' 2022-08-05 10:02:07 -07:00
m68k hw: Add compat machines for 7.2 2022-08-25 21:59:04 +02:00
mem
microblaze
mips hw/mips/malta: turn off x86 specific features of PIIX4_PM 2022-08-08 23:23:11 +02:00
misc hw/misc/grlib_ahb_apb_pnp: Support 8 and 16 bit accesses 2022-08-08 23:43:11 +02:00
net net: tulip: Restrict DMA engine to memories 2022-09-02 10:22:39 +08:00
nios2 hw/nios2: virt: pass random seed to fdt 2022-07-22 19:01:44 +02:00
nubus
nvme hw/nvme: do not enable ioeventfd by default 2022-08-01 12:01:21 +02:00
nvram block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
openrisc
pci
pci-bridge
pci-host ppc/pnv: fix QOM parenting of user creatable root ports 2022-08-31 14:08:06 -03:00
pcmcia
ppc ppc patch queue for 2022-08-31: 2022-09-01 13:53:20 -04:00
rdma
remote
riscv
rtc
rx hw/rx: pass random seed to fdt 2022-07-22 19:01:44 +02:00
s390x s390x/cpumodel: add stfl197 processor-activity-instrumentation extension 1 2022-08-25 21:59:04 +02:00
scsi scsi-generic: Fix emulated block limits VPD page 2022-08-23 16:01:13 +02:00
sd block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
sensor hw/sensor: Add Renesas ISL69259 device model 2022-07-14 16:24:38 +02:00
sh4
smbios
sparc
sparc64
ssi
timer
tpm
tricore
usb hw/usb/hcd-xhci: Fix unbounded loop in xhci_ring_chain_length() (CVE-2020-14394) 2022-08-16 11:37:19 +02:00
vfio
virtio vdpa: Delete CVQ migration blocker 2022-09-02 10:22:39 +08:00
watchdog ppc/spapr: Implement H_WATCHDOG 2022-07-06 10:22:38 -03:00
xen
xenpv
xtensa
Kconfig
meson.build