CVE-2026-31700
net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()
Reported by linux · Published May 1, 2026
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel6.18-modules-extra | Amazon Linux | 1:6.18.25-55.108.amzn2023 |
| kernel | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| linux-aws-6.18 | Chainguard | 6.18.31-r0 |
| bpftool | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| kernel-livepatch-6.12.88-119.157 | Amazon Linux | 1:1.0-0.amzn2023 |
| linux-vmware-6.18 | Chainguard | 6.18.31-r0 |
| python3-perf6.18 | Amazon Linux | 1:6.18.25-55.108.amzn2023 |
| kernel-tools | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| perf | Amazon Linux | 1:6.1.175-219.357.amzn2023 |
| kernel6.12 | Amazon Linux | 1:6.12.88-119.157.amzn2023 |
| kernel6.12-modules-extra | Amazon Linux | 1:6.12.88-119.157.amzn2023 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 1d036d25e5609ba73fee6a88db01c306b140d512, 1d036d25e5609ba73fee6a88db01c306b140d512, 1d036d25e5609ba73fee6a88db01c306b140d512 |
| Linux | Linux | 4.6, 0, 5.10.259 |
| amazon:2023 | kernel6.18-modules-extra | 0 |
| amazon:2023 | kernel | 0 |
| chainguard | linux-aws-6.18 | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-livepatch-6.12.88-119.157 | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | 3.1.6, 3.1.7 |
| chainguard | linux-vmware-6.18 | 0 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) | 3.1.7, 3.1.6 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | 3.1.7, 3.1.6 |
| amazon:2023 | python3-perf6.18 | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel6.12 | 0 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| linux | linux_kernel | 4.6, 4.6, 4.6 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel6.18-modules-extra-common | 0 |
| amazon:2023 | bpftool6.12 | 0 |
…and 33 more
Timeline
- May 1, 2026 CVE Published
- May 18, 2026 EPSS Score (24 in total, the first dated here)
- Jun 2, 2026 Security Advisory (120 in total, the first dated here)
- Jul 28, 2026 Coalition ESS Score
- Aug 11, 2026 Distribution Patch (114 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-31700
vulnetix vdb fixes CVE-2026-31700
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-31700/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart