linux/drivers/vhost
Enrico Zanda 3c0d10f233 vhost-net: fix TX stall when vhost owns virtio-net header
When vhost owns the virtio-net header, i.e. when
VHOST_NET_F_VIRTIO_NET_HDR is negotiated, sock_hlen is 0,
meaning that no header will be forwarded to the TAP device.

In the current vhost_net_build_xdp() implementation,
when sock_hlen == 0, the gso pointer can point at the start of the
Ethernet frame instead of a virtio-net header.
This results in a wrong interpretation of the destination MAC address
bytes as struct virtio_net_hdr fields.

This can, for some MAC addresses, trigger -EINVAL and return early
before the TX descriptor is completed, which can stall vhost-net TX.

Before 97b2409f28, the gso pointer was set to the zeroed padding area,
using it as a synthetic virtio-net header. Restore that behavior.

Fixes: 97b2409f28 ("vhost-net: reduce one userspace copy when building XDP buff")
Signed-off-by: Enrico Zanda <enrico.zanda@arm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20260708152242.2268848-1-enrico.zanda@arm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-21 13:25:34 +02:00
..
iotlb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig vhost: Reintroduce kthread API and add mode selection 2025-08-01 09:11:09 -04:00
Makefile
net.c vhost-net: fix TX stall when vhost owns virtio-net header 2026-07-21 13:25:34 +02:00
scsi.c scsi: vhost-scsi: Report direction completion support 2026-02-28 21:04:03 -05:00
test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
test.h
vdpa.c vhost/vdpa: validate virtqueue index in mmap and fault paths 2026-06-10 02:14:01 -04:00
vhost.c vhost: remove unnecessary module_init/exit functions 2026-06-10 02:17:00 -04:00
vhost.h kcov: refactor common handle ID into kcov_common_handle_id 2026-05-28 21:24:45 -07:00
vringh.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
vsock.c vhost/vsock: Refuse the connection immediately when guest isn't ready 2026-06-10 02:14:01 -04:00