{"id":"CVE-2026-31700","aliases":["CVE-2026-31700"],"related":[],"kind":"vulnerability","state":"published","title":"net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()\n\nIn tpacket_snd(), when PACKET_VNET_HDR is enabled, vnet_hdr points\ndirectly into the mmap'd TX ring buffer shared with userspace. The\nkernel validates the header via __packet_snd_vnet_parse() but then\nre-reads all fields later in virtio_net_hdr_to_skb(). A concurrent\nuserspace thread can modify the vnet_hdr fields between validation\nand use, bypassing all safety checks.\n\nThe non-TPACKET path (packet_snd()) already correctly copies vnet_hdr\nto a stack-local variable. All other vnet_hdr consumers in the kernel\n(tun.c, tap.c, virtio_net.c) also use stack copies. The TPACKET TX\npath is the only caller of virtio_net_hdr_to_skb() that reads directly\nfrom user-controlled shared memory.\n\nFix this by copying vnet_hdr from the mmap'd ring buffer to a\nstack-local variable before validation and use, consistent with the\napproach used in packet_snd() and all other callers.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()\n\nIn tpacket_snd(), when PACKET_VNET_HDR is enabled, vnet_hdr points\ndirectly into the mmap'd TX ring buffer shared with userspace. The\nkernel validates the header via __packet_snd_vnet_parse() but then\nre-reads all fields later in virtio_net_hdr_to_skb(). A concurrent\nuserspace thread can modify the vnet_hdr fields between validation\nand use, bypassing all safety checks.\n\nThe non-TPACKET path (packet_snd()) already correctly copies vnet_hdr\nto a stack-local variable. All other vnet_hdr consumers in the kernel\n(tun.c, tap.c, virtio_net.c) also use stack copies. The TPACKET TX\npath is the only caller of virtio_net_hdr_to_skb() that reads directly\nfrom user-controlled shared memory.\n\nFix this by copying vnet_hdr from the mmap'd ring buffer to a\nstack-local variable before validation and use, consistent with the\napproach used in packet_snd() and all other callers.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnet/packet: corregir la condición de carrera TOCTOU en vnet_hdr mapeado por mmap en tpacket_snd()\n\nEn tpacket_snd(), cuando PACKET_VNET_HDR está habilitado, vnet_hdr apunta directamente al búfer de anillo TX mapeado por mmap compartido con el espacio de usuario. El kernel valida el encabezado a través de __packet_snd_vnet_parse() pero luego vuelve a leer todos los campos más tarde en virtio_net_hdr_to_skb(). Un hilo concurrente del espacio de usuario puede modificar los campos de vnet_hdr entre la validación y el uso, eludiendo todas las comprobaciones de seguridad.\n\nLa ruta no-TPACKET (packet_snd()) ya copia correctamente vnet_hdr a una variable local de la pila. Todos los demás consumidores de vnet_hdr en el kernel (tun.c, tap.c, virtio_net.c) también usan copias en la pila. La ruta TPACKET TX es el único llamador de virtio_net_hdr_to_skb() que lee directamente de memoria compartida controlada por el usuario.\n\nSolucione esto copiando vnet_hdr del búfer de anillo mapeado por mmap a una variable local de la pila antes de la validación y el uso, consistente con el enfoque utilizado en packet_snd() y todos los demás llamadores.","source":"nvd"}],"published":"2026-05-01T13:56:00.205Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-362","CWE-367"],"affected":[{"ranges":[{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"0f4c9754956b86de158a4af5278c5cf5bda9439e","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"714aa973da8163925eda7efd49361ccbee21ee46","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"1490f82353bdabc09265a74e645b07f05cf4188e","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"3a1bf9116ea31470b89692585c3910dfe830dcdd","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"28324a3b62d9ce7f9bdd65a8ce63f382041d1b27","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b","status":"affected"},{"type":"git","introduced":"1d036d25e5609ba73fee6a88db01c306b140d512","fixed":"2c054e17d9d41f1020376806c7f750834ced4dc5","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.6","status":"unaffected"},{"type":"semver","introduced":"5.10.259","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.210","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.176","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.136","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.84","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.25","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.2","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.6","fixed":"6.6.136"},{"status":"affected","introduced":"6.7","fixed":"6.12.84"},{"status":"affected","introduced":"6.13","fixed":"6.18.25"},{"status":"affected","introduced":"6.19","fixed":"7.0.2"},{"status":"affected","version":"7.1"},{"status":"affected","version":"7.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/0f4c9754956b86de158a4af5278c5cf5bda9439e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/714aa973da8163925eda7efd49361ccbee21ee46","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1490f82353bdabc09265a74e645b07f05cf4188e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3a1bf9116ea31470b89692585c3910dfe830dcdd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/28324a3b62d9ce7f9bdd65a8ce63f382041d1b27","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2c054e17d9d41f1020376806c7f750834ced4dc5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T15:12:43.080Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31700","url":"https://www.cve.org/CVERecord?id=CVE-2026-31700","licence":"CVE Terms of Use","modified":"2026-11-10T12:45:34.144Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31700","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31700","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.336Z","epss":{"score":0.00146,"percentile":0.04048,"date":"2026-12-01T12:00:22.000Z"}}