CVE-2026-31700
Race Condition in Linux Kernel Packet Socket
Publication date: 2026-05-01
Last updated on: 2026-05-06
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | From 6.7 (inc) to 6.12.84 (exc) |
| linux | linux_kernel | From 4.6 (inc) to 6.6.136 (exc) |
| linux | linux_kernel | 7.1 |
| linux | linux_kernel | 7.1 |
| linux | linux_kernel | From 6.13 (inc) to 6.18.25 (exc) |
| linux | linux_kernel | From 6.19 (inc) to 7.0.2 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-362 | The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Linux kernel's network packet sending function tpacket_snd() when the PACKET_VNET_HDR feature is enabled. The issue is a time-of-check to time-of-use (TOCTOU) race condition involving the vnet_hdr structure, which points directly into a memory-mapped transmit ring buffer shared with userspace.
The kernel first validates the vnet_hdr fields but then re-reads them later from the shared memory without copying them to a safe location. Because userspace can concurrently modify these fields between validation and use, it can bypass the kernel's safety checks.
The fix involves copying the vnet_hdr data from the shared mmap buffer to a stack-local variable before validation and use, preventing userspace from modifying the data during processing and thus eliminating the race condition.
How can this vulnerability impact me? :
This vulnerability can allow a malicious userspace process to manipulate network packet headers after the kernel has validated them but before they are used, potentially bypassing security checks.
Such manipulation could lead to unexpected behavior in packet processing, possibly enabling privilege escalation, data corruption, or network attacks by injecting malformed or unauthorized packets.
What immediate steps should I take to mitigate this vulnerability?
The vulnerability is fixed by updating the Linux kernel to a version where the TOCTOU race condition in tpacket_snd() is resolved.
Specifically, the fix involves copying the vnet_hdr from the mmap'd ring buffer to a stack-local variable before validation and use, preventing concurrent userspace modifications from bypassing safety checks.
Therefore, the immediate mitigation step is to apply the kernel update that includes this fix.