1. Home
  2. Vulnerabilities
  3. CVE-2026-31700

CVE-2026-31700

net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()

Published 1 May 2026 · modified 11 Nov 2026 · Sources: NVD, CNA (vendor or assigner), CERT-FR, EPSS (FIRST)

Low 32/100

Summary

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

Linux (6 line(s))
Linux
ProductVersionsFixed inSource
Linux 4.6 — CNA (vendor or assigner)
Linux kernel from 4.6 (included) to 6.6.136 (excluded) — NVD
Linux kernel from 6.7 (included) to 6.12.84 (excluded) — NVD
Linux kernel from 6.13 (included) to 6.18.25 (excluded) — NVD
Linux kernel from 6.19 (included) to 7.0.2 (excluded) — NVD
Linux kernel 7.1 — NVD

Fix

Not provided by the vendor.

Workaround

No workaround provided.

Check whether you are affected

No verification method provided.

Timeline

  1. — CVE published (cve)
  2. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1286)
  3. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1298)
  4. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1333)
  5. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1385)
  6. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1469)
  7. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1537)

CERT-FR advisories

References

Data provenance

Status
NVD
Publication date
NVD
Description
CNA (vendor or assigner)
CVSS score
CNA (vendor or assigner)
Weakness (CWE)
NVD
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1, CNA:416baaa9-dc9f-4396-8d5f-8c081fb06d67)
Weakness
CWE-362 · Autre (CWE-362)

How this data is obtained and calculated