qemu/hw
Alexey Dobriyan 2c3e4e2de6 virtio-net: drop too short packets early
Reproducer from https://gitlab.com/qemu-project/qemu/-/issues/1451
creates small packet (1 segment, len = 10 == n->guest_hdr_len),
then destroys queue.

"if (n->host_hdr_len != n->guest_hdr_len)" is triggered, if body creates
zero length/zero segment packet as there is nothing after guest header.

qemu_sendv_packet_async() tries to send it.

slirp discards it because it is smaller than Ethernet header,
but returns 0 because tx hooks are supposed to return total length of data.

0 is propagated upwards and is interpreted as "packet has been sent"
which is terrible because queue is being destroyed, nobody is waiting for TX
to complete and assert it triggered.

Fix is discard such empty packets instead of sending them.

Length 1 packets will go via different codepath:

	virtqueue_push(q->tx_vq, elem, 0);
	virtio_notify(vdev, q->tx_vq);
	g_free(elem);

and aren't problematic.

Signed-off-by: Alexey Dobriyan <adobriyan@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2024-06-04 15:14:26 +08:00
..
9pfs xen: register legacy backends via xen_backend_init 2024-05-10 15:45:15 +02:00
acpi hmat acpi: Fix out of bounds access due to missing use of indirection 2024-03-12 17:59:46 -04:00
adc hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
alpha alpha: switch boards to "default y" 2024-05-03 15:47:47 +02:00
arm arm/sbsa-ref: move to Neoverse-N2 as default 2024-05-30 13:21:06 +01:00
audio misc: Use QEMU header path relative to include/ directory 2024-05-09 00:07:21 +02:00
avr avr: switch boards to "default y" 2024-05-03 15:47:47 +02:00
block hw/pflash: fix block write start 2024-05-17 16:49:04 +02:00
char hw: arm: Remove use of tabs in some source files 2024-05-28 14:20:48 +01:00
core Migration pull request 2024-05-22 15:32:25 -07:00
cpu hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device 2024-04-25 12:48:12 +02:00
cris cris: switch boards to "default y" 2024-05-03 15:47:47 +02:00
cxl hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean 2024-04-25 12:48:12 +02:00
display virtio-gpu: fix v2 migration 2024-05-22 17:34:41 -03:00
dma xlnx_dpdma: fix descriptor endianness bug 2024-05-28 14:20:48 +01:00
fsi
gpio hw: arm: Remove use of tabs in some source files 2024-05-28 14:20:48 +01:00
hppa hw/hppa/machine: Replace g_memdup() by g_memdup2() 2024-05-08 19:42:45 +02:00
hyperv kvm: move target-dependent interrupt routing out of kvm-all.c 2024-05-03 15:47:48 +02:00
i2c hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
i386 hw/i386/pc: Support smp.modules for x86 PC machine 2024-05-22 19:43:29 +02:00
ide hw/ide/core.c (cmd_read_native_max): Avoid limited device parameters 2024-04-30 06:21:47 +02:00
input hw: arm: Remove use of tabs in some source files 2024-05-28 14:20:48 +01:00
intc hw/intc/arm_gic: Fix writes to GICD_ITARGETSRn 2024-05-30 13:21:06 +01:00
ipack
ipmi
isa hw/isa/vt82c686: Keep track of PIRQ/PINT pins separately 2024-04-15 13:07:11 +02:00
loongarch hw/loongarch/virt: Fix FDT memory node address width 2024-05-23 09:30:41 +08:00
m68k m68k: switch boards to "default y" 2024-05-03 15:47:47 +02:00
mem hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean 2024-04-25 12:48:12 +02:00
microblaze microblaze: switch boards to "default y" 2024-05-03 15:47:47 +02:00
mips kconfig: express dependency of individual boards on libfdt 2024-05-10 15:45:15 +02:00
misc hw: misc: edu: use qemu_log_mask instead of hw_error 2024-04-30 06:21:47 +02:00
net virtio-net: drop too short packets early 2024-06-04 15:14:26 +08:00
nubus
nvme hw/nvme: fix -Werror=maybe-uninitialized 2024-04-02 16:15:07 +02:00
nvram hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
openrisc kconfig: express dependency of individual boards on libfdt 2024-05-10 15:45:15 +02:00
pci hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
pci-bridge Misc HW patch queue 2024-04-25 09:43:29 -07:00
pci-host hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
pcmcia
ppc target/ppc: Remove id_tlbs flag from CPU env 2024-05-24 09:43:11 +10:00
remote hw/remote/vfio-user: Fix config space access byte order 2024-05-08 19:43:15 +02:00
riscv kconfig: express dependency of individual boards on libfdt 2024-05-10 15:45:15 +02:00
rtc hw/i386: move rtc-reset-reinjection command out of hw/rtc 2024-05-10 15:45:15 +02:00
rx kconfig: express dependency of individual boards on libfdt 2024-05-10 15:45:15 +02:00
s390x s390: move css_migration_enabled from machine to css.c 2024-05-10 15:45:15 +02:00
scsi esp.c: remove explicit setting of DRQ within ESP state machine 2024-04-04 15:17:53 +01:00
sd hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set 2024-04-10 09:09:34 +02:00
sensor hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
sh4 sh4: select correct components for no-board build 2024-05-10 15:45:14 +02:00
smbios hw/smbios: add stub for smbios_get_table_legacy() 2024-03-26 14:32:54 +01:00
sparc sparc: switch boards to "default y" 2024-05-03 15:47:48 +02:00
sparc64 qemu-sparc queue 2024-05-06 10:19:56 -07:00
ssi Misc HW patch queue 2024-04-25 09:43:29 -07:00
timer hw, target: Add ResetType argument to hold and exit phase methods 2024-04-25 10:21:06 +01:00
tpm
tricore tricore: switch boards to "default y" 2024-05-03 15:47:48 +02:00
ufs hw/ufs: Add support MCQ of UFSHCI 4.0 2024-06-03 16:20:42 +09:00
usb hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT 2024-05-31 11:26:00 +01:00
vfio vfio/igd: Use g_autofree in vfio_probe_igd_bar4_quirk() 2024-05-22 10:04:22 +02:00
virtio memory: Add Error** argument to memory_get_xlat_addr() 2024-05-16 16:59:19 +02:00
watchdog hw/watchdog/sbsa_gwdt: Make watchdog timer frequency a QOM property 2024-04-30 15:14:15 +01:00
xen xen: register legacy backends via xen_backend_init 2024-05-10 15:45:15 +02:00
xenpv xen: initialize legacy backends from xen_bus_init() 2024-05-10 15:45:15 +02:00
xtensa hw/xtensa: require libfdt 2024-05-10 15:45:15 +02:00
Kconfig hw: Fix problem with the A*MPCORE switches in the Kconfig files 2024-04-25 12:48:12 +02:00
meson.build hw/rdma: Remove deprecated pvrdma device and rdmacm-mux helper 2024-04-24 16:03:38 +02:00