792676c165
If the driver sets large_send_mss to 0 then a divide-by-zero occurs.
Even if the division wasn't a problem, the for loop that emits MSS-sized
packets would never terminate.
Solve these issues by skipping offloading when large_send_mss=0.
This issue was found by OSS-Fuzz as part of Alexander Bulekov's device
fuzzing work. The reproducer is:
$ cat << EOF | ./qemu-system-i386 -display none -machine accel=qtest, -m \
512M,slots=1,maxmem=0xffff000000000000 -machine q35 -nodefaults -device \
rtl8139,netdev=net0 -netdev user,id=net0 -device \
pc-dimm,id=nv1,memdev=mem1,addr=0xb800a64602800000 -object \
memory-backend-ram,id=mem1,size=2M -qtest stdio
outl 0xcf8 0x80000814
outl 0xcfc 0xe0000000
outl 0xcf8 0x80000804
outw 0xcfc 0x06
write 0xe0000037 0x1 0x04
write 0xe00000e0 0x2 0x01
write 0x1 0x1 0x04
write 0x3 0x1 0x98
write 0xa 0x1 0x8c
write 0xb 0x1 0x02
write 0xc 0x1 0x46
write 0xd 0x1 0xa6
write 0xf 0x1 0xb8
write 0xb800a646028c000c 0x1 0x08
write 0xb800a646028c000e 0x1 0x47
write 0xb800a646028c0010 0x1 0x02
write 0xb800a646028c0017 0x1 0x06
write 0xb800a646028c0036 0x1 0x80
write 0xe00000d9 0x1 0x40
EOF
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1582
Closes: https://gitlab.com/qemu-project/qemu/-/issues/1582
Cc: qemu-stable@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>
Fixes:
|
||
---|---|---|
.. | ||
can | ||
fsl_etsec | ||
rocker | ||
allwinner_emac.c | ||
allwinner-sun8i-emac.c | ||
cadence_gem.c | ||
dp8393x.c | ||
e1000_common.h | ||
e1000_regs.h | ||
e1000.c | ||
e1000e_core.c | ||
e1000e_core.h | ||
e1000e.c | ||
e1000x_common.c | ||
e1000x_common.h | ||
e1000x_regs.h | ||
eepro100.c | ||
etraxfs_eth.c | ||
ftgmac100.c | ||
i82596.c | ||
i82596.h | ||
igb_common.h | ||
igb_core.c | ||
igb_core.h | ||
igb_regs.h | ||
igb.c | ||
igbvf.c | ||
imx_fec.c | ||
Kconfig | ||
lan9118.c | ||
lance.c | ||
lasi_i82596.c | ||
mcf_fec.c | ||
meson.build | ||
mipsnet.c | ||
msf2-emac.c | ||
mv88w8618_eth.c | ||
ne2000-isa.c | ||
ne2000-pci.c | ||
ne2000.c | ||
ne2000.h | ||
net_rx_pkt.c | ||
net_rx_pkt.h | ||
net_tx_pkt.c | ||
net_tx_pkt.h | ||
npcm7xx_emc.c | ||
opencores_eth.c | ||
pcnet-pci.c | ||
pcnet.c | ||
pcnet.h | ||
rtl8139.c | ||
smc91c111.c | ||
spapr_llan.c | ||
stellaris_enet.c | ||
sungem.c | ||
sunhme.c | ||
trace-events | ||
trace.h | ||
tulip.c | ||
tulip.h | ||
vhost_net-stub.c | ||
vhost_net.c | ||
virtio-net.c | ||
vmware_utils.h | ||
vmxnet3_defs.h | ||
vmxnet3.c | ||
vmxnet3.h | ||
vmxnet_debug.h | ||
xen_nic.c | ||
xgmac.c | ||
xilinx_axienet.c | ||
xilinx_ethlite.c |