linux/drivers
Willem de Bruijn 07e1a9408b virtio_net: copy zerocopy frags in start_xmit without NAPI
Virtio-net without NAPI frees completed skbs lazily on the next
start_xmit. Senders waiting for in-flight zerocopy buffers can
deadlock if they cannot transmit more packets, as then no
completed packets will be freed.

When !use_napi, virtio-net already calls skb_orphan to avoid waiting
up for transmitted skbs to be freed. For zerocopy packets that
require deep copying on orphan (i.e. those that do not set
SKBFL_DONT_ORPHAN, such as PACKET_TX_RING), call skb_orphan_frags
before orphaning to release the buffers.

This fixes the tpacket_snd slot reuse bug on skb_orphan for
virtio-net, and prevents PACKET_TX_RING from running out of slots.

This fix also touches vhost_net zerocopy packets, which also do not
set SKBFL_DONT_ORPHAN. This is fine: vhost_net packets only encounter
virtio-net in nested virtualization, and only if napi_tx is
explicitly disabled (it has been default-enabled since Linux 4.12).
In that rare case, copying the frags is desirable anyway to prevent
holding guest descriptors pinned across unbounded intervals.

This is a prerequisite for the next patch, which converts
PACKET_TX_RING to standard zerocopy completion. Without this patch
first, a bounded ring sender can stall indefinitely behind a
virtio-net virtqueue that cannot reclaim.

Fixes: 5cd8d46ea1 ("packet: copy user buffers before orphan or clone")
Cc: stable@vger.kernel.org
Cc: mst@redhat.com
Cc: jasowangio@gmail.com
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260919004748.1463985-2-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-22 18:32:57 -07:00
..
accel Merge drm/drm-fixes into drm-misc-fixes 2026-09-08 13:32:08 +02:00
accessibility
acpi treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
amba
android Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
ata ata: libata-scsi: do not raise UA for storage element depopulation and restoration 2026-09-03 16:10:44 +02:00
atm
auxdisplay auxdisplay for v7.3-1 2026-08-24 08:15:59 -07:00
base kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
bcma
block block-7.3-20260911 2026-09-11 12:38:44 -07:00
bluetooth Bluetooth: btintel_pcie: validate device-supplied DMA indices 2026-09-21 09:37:20 -04:00
bus Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cache
cdrom
cdx
char virtio_console: do not free control-out buffers on remove 2026-09-07 18:54:02 -04:00
clk treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
clocksource hyperv-next for v7.3-rc1 2026-08-26 16:47:40 -07:00
comedi
connector
counter Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cpufreq Merge branch 'pm-cpufreq' 2026-09-10 20:16:37 +02:00
cpuidle cpuidle: dt_idle_genpd: kfree() the original name allocation 2026-09-01 17:28:56 +02:00
crypto treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
cxl
dax mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
dca
devfreq treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
dibs dibs: Unregister dibs_class after error 2026-09-04 16:12:24 -07:00
dio
dma treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
dma-buf kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
dpll dpll: use exact lookup for reference sync pin id 2026-09-21 17:19:42 -07:00
edac EDAC/altera: Use parent device for devres in altr_portb_setup() 2026-09-07 21:29:44 -07:00
eisa
extcon
firewire firewire updates for v7.3 2026-08-22 08:41:28 -07:00
firmware treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
fpga treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
fsi
fwctl rust: introduce abstractions for fwctl 2026-08-14 19:21:17 -03:00
gnss
gpib Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
gpio gpio fixes for v7.3-rc4 2026-09-17 09:08:20 -07:00
gpu Rust fixes for v7.3 (2nd) 2026-09-13 09:28:28 -07:00
greybus
hid treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hsi HSI changes for the 7.3 series 2026-08-21 12:01:23 -07:00
hte
hv treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hwmon hwmon: (nct6694) do not expose enable on DTIN temperature channels 2026-09-09 18:16:35 -07:00
hwspinlock
hwtracing treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
i2c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
i3c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
idle Merge branch 'intel-idle-lpi' 2026-08-07 21:22:50 +02:00
iio treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
infiniband RDMA v7.3 first rc pull 2026-09-14 09:58:12 -07:00
input treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
interconnect This pull request contains the following interconnect updates for 2026-08-19 09:55:37 +02:00
iommu iommu/amd: Remove unused macro 2026-09-11 17:27:22 +02:00
ipack Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
irqchip irqchip/gic-v5: Preserve ICC_CR0_EL1 state 2026-09-07 21:44:17 +02:00
leds LEDs for v7.3 2026-08-27 11:05:51 -07:00
macintosh
mailbox treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mcb
md treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
media media: ipu-bridge: do not use the CVS device lookup for IVSC 2026-09-13 10:15:16 -07:00
memory * Raw NAND changes 2026-08-23 09:11:21 -07:00
memstick
message
mfd treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
misc Merge drm/drm-fixes into drm-misc-fixes 2026-09-01 09:38:51 +02:00
mmc MMC core: 2026-08-21 11:58:08 -07:00
most
mtd treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mux
net virtio_net: copy zerocopy frags in start_xmit without NAPI 2026-09-22 18:32:57 -07:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
ntb NTB: ntb_transport: Reject oversized TX buffers 2026-08-20 13:43:24 -07:00
nubus
nvdimm treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
nvme kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
nvmem Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
of Devicetree fixes for v7.3, part 1: 2026-08-27 12:53:43 -07:00
opp OPP updates for 7.3-rc2 2026-09-09 19:03:00 +02:00
parisc parisc: eisa: Fix infinite loop when parsing invalid IRQ value 2026-08-18 11:43:05 +02:00
parport
pci treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pcmcia
peci
perf perf: RISC-V: check cpu_hw_evt before dereference in overflow IRQ 2026-09-01 19:19:48 -06:00
phy Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
pinctrl Pin control bulk changes for kernel v7.3 2026-08-24 08:46:03 -07:00
platform platform-drivers-x86 for v7.3-2 2026-09-11 12:52:48 -07:00
pmdomain treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pnp Merge branches 'acpi-numa', 'acpi-misc' and 'pnp' 2026-08-07 20:01:31 +02:00
power power sequencing fixes for v7.3-rc4 2026-09-17 09:40:25 -07:00
powercap More power management updates for 7.3-rc1 2026-08-26 14:13:26 -07:00
pps
ps3
ptp treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pwm Driver core changes for 7.3-rc1 2026-08-19 10:42:18 -07:00
rapidio
ras - Mark the mpc85xx and ThunderX EDAC drivers as orphaned due to lack of 2026-08-31 20:10:39 -07:00
regulator regulator: pf1550: fix which regulator is notified 2026-09-07 18:08:38 +01:00
remoteproc
resctrl arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
reset Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
rpmsg
rtc RTC for 7.3 2026-08-28 09:53:43 -07:00
s390 Nothing too exciting, usual stream of fixes. 2026-09-10 14:07:48 -07:00
sbus
scsi kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
sh
siox
slimbus
soc treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
soundwire soundwire updates for 7.3 2026-08-24 12:16:16 -07:00
spi treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
spmi
ssb
staging Staging driver fixes for 7.3-rc2 2026-09-06 09:49:06 -07:00
target scsi: target: iscsi: Reserve a terminator byte for the login payload 2026-09-01 22:08:31 -04:00
tc
tee treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
thermal thermal: sysfs: switch to use scnprintf() to suppress truncation warning 2026-09-04 15:49:46 +02:00
thunderbolt treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
tty fbdev fixes for 7.3-rc3: 2026-09-12 08:06:04 -07:00
ufs kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
uio
usb USB fixes for 7.3-rc2 2026-09-06 08:50:20 -07:00
vdpa vduse: return compat ioctl results directly 2026-09-08 03:58:27 -04:00
vfio mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
vhost vhost: invalidate vring access on IOTLB transitions 2026-09-07 18:54:04 -04:00
video fbdev fixes for 7.3-rc3: 2026-09-12 08:06:04 -07:00
virt arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
virtio virtio_input: stop callbacks before unregistering input device 2026-09-07 18:54:04 -04:00
w1
watchdog watchdog: msc313e: Sync timeout value if WDT was running at boot 2026-09-09 14:18:25 -07:00
xen treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
zorro
Kconfig
Makefile