CVE-2026-31700 In the Linux kernel, the following vulnerability has been resolved: net/packet: fix TOCTOU race on mmap'd vnet_hdr in…
Description
In the Linux kernel, the following vulnerability has been resolved: net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd() In tpacket_snd(), when PACKET_VNET_HDR is enabled, vnet_hdr points directly into the mmap'd TX ring buffer shared with userspace. The kernel validates the header via __packet_snd_vnet_parse() but then re-reads all fields later in virtio_net_hdr_to_skb(). A concurrent userspace thread can modify the vnet_hdr fields between validation and use, bypassing all safety checks. The non-TPACKET path (packet_snd()) already correctly copies vnet_hdr to a stack-local variable. All other vnet_hdr consumers in the kernel (tun.c, tap.c, virtio_net.c) also use stack copies. The TPACKET TX path is the only caller of virtio_net_hdr_to_skb() that reads directly from user-controlled shared memory. Fix this by copying vnet_hdr from the mmap'd ring buffer to a stack-local variable before validation and use, consistent with the approach used in packet_snd() and all other callers.
Affected products and versions
| Product | Affected versions | Fixed in |
|---|---|---|
| Linux 7.1 | earliest → < 7.1 | 7.1 |
| Linux 7.0 | earliest → < 7.0.2 | 7.0.2 |
| Linux 6.18 | earliest → < 6.18.25 | 6.18.25 |
| Linux 6.12 | earliest → < 6.12.84 | 6.12.84 |
| Linux 6.6 | earliest → < 6.6.136 | 6.6.136 |
| Linux 6.1 | earliest → < 6.1.176 | 6.1.176 |
| Linux 5.15 | earliest → < 5.15.210 | 5.15.210 |
| Linux 5.10 | earliest → < 5.10.259 | 5.10.259 |
| Linux | 4.6 | No fix stated |
Show the 4 other branches Hide the 4 other branches
| Product | Affected versions | Fixed in |
|---|---|---|
| SIMATIC S7-1500 CPU 1518-4 PN/DP MFP 3.1 | 3.1.7 → latest | No fix stated |
| SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP 3.1 | 3.1.7 → latest | No fix stated |
| SIPLUS S7-1500 CPU 1518-4 PN/DP MFP 3.1 | 3.1.7 → latest | No fix stated |
| SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | Versions not published |
References
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
- git.kernel.org git.kernel.org
Timeline
- Published
- Last modified