CVE-2026-31700
net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()
Check your servers for CVE-2026-31700
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-31700 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.15%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 4.05% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 16 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 0f4c9754956b86de158a4af5278c5cf5bda9439e affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 714aa973da8163925eda7efd49361ccbee21ee46 affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 1490f82353bdabc09265a74e645b07f05cf4188e affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121 affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 3a1bf9116ea31470b89692585c3910dfe830dcdd affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 28324a3b62d9ce7f9bdd65a8ce63f382041d1b27 affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b affected from 1d036d25e5609ba73fee6a88db01c306b140d512, before 2c054e17d9d41f1020376806c7f750834ced4dc5
Other versions: unaffected
|
| Linux |
affected 4.6 unaffected before 4.6 unaffected from 5.10.259 up to and including 5.10.* unaffected from 5.15.210 up to and including 5.15.* unaffected from 6.1.176 up to and including 6.1.* unaffected from 6.6.136 up to and including 6.6.* unaffected from 6.12.84 up to and including 6.12.* unaffected from 6.18.25 up to and including 6.18.* unaffected from 7.0.2 up to and including 7.0.* unaffected 7.1 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2026-31700 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-31700
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2026-31700
trivy image --scanners vuln IMAGE | grep CVE-2026-31700
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/0f4c9754956b86de158a4af5278c5cf5bda9439e git.kernel.org
- https://git.kernel.org/stable/c/714aa973da8163925eda7efd49361ccbee21ee46 git.kernel.org
- https://git.kernel.org/stable/c/1490f82353bdabc09265a74e645b07f05cf4188e git.kernel.org
- https://git.kernel.org/stable/c/74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121 git.kernel.org
- https://git.kernel.org/stable/c/3a1bf9116ea31470b89692585c3910dfe830dcdd git.kernel.org
- https://git.kernel.org/stable/c/28324a3b62d9ce7f9bdd65a8ce63f382041d1b27 git.kernel.org
- https://git.kernel.org/stable/c/48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b git.kernel.org
- https://git.kernel.org/stable/c/2c054e17d9d41f1020376806c7f750834ced4dc5 git.kernel.org
- https://cert-portal.siemens.com/productcert/html/ssa-019113.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-457936.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-784472.html cert-portal.siemens.com
Source: the record CVE-2026-31700 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse