CVE-2026-31700: net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()
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.
Security readout for executives and security teams
Plain-English summary
A local user or workload with limited privileges may race the Linux kernel while it processes a shared packet-transmission header. Winning the race can bypass safety checks and may compromise confidentiality, integrity, or availability. Network access alone is insufficient; the vulnerable packet-ring path must be reachable locally.
Executive priority
Treat as a high-priority local privilege-boundary issue, especially on shared Linux hosts or systems executing less-trusted workloads. It does not appear remotely exploitable from the supplied evidence, and active exploitation is unconfirmed. Patch through supported kernel channels after validating vendor applicability.
Technical view
In tpacket_snd(), an mmap-backed virtio network header remained in userspace-controlled shared memory after validation. Another thread could alter fields before virtio_net_hdr_to_skb() reused them, creating a time-of-check-to-time-of-use race. The kernel fix copies the header to stack-local memory before validation and subsequent use.
Likely exposure
Exposure is limited to affected Linux kernels where a local low-privileged user or workload can reach the TPACKET transmit-ring path with PACKET_VNET_HDR enabled. The supplied affected-version data is ambiguous, so organizations should verify distribution-specific kernel advisories or match their kernel against the listed stable fixes.
Exploitation context
The supplied record gives CVSS 3.1 score 7.8 with local access, low complexity, low privileges, and no user interaction. It is not listed in KEV, and the supplied sources provide no evidence of active exploitation or public weaponization.
Researcher notes
The flaw is isolated to tpacket_snd() because it directly reused an mmap-backed, userspace-controlled vnet_hdr. Other named consumers already used local copies. The remediation removes the race by snapshotting the header before parsing. The bundle does not identify a CWE, prerequisite permissions beyond CVSS PR:L, or demonstrated exploit behavior.
Mitigation direction
Install a vendor-supported kernel containing the applicable upstream stable fix.
Check distribution advisories before relying on the bundle's ambiguous affected-version list.
Prioritize multi-user hosts and systems running less-trusted local workloads.
Restrict unnecessary access to the affected packet-socket functionality until patched.
Validation and detection
Record each system's running kernel version and distribution package release.
Confirm vendor changelogs reference CVE-2026-31700 or a listed stable commit.
Identify workloads able to access TPACKET transmit rings with PACKET_VNET_HDR.
Reboot after updating and verify the fixed kernel is running.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31700 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
9Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.