{"id":"CVE-2026-31700","revision":"460d771f2e8c47ea9c72b1dd02720fa8","records":[{"revision":"460d771f2e8c47ea9c72b1dd02720fa8","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-31700","aliases":[],"title":"net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()","description":"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.","state":0,"publishedAt":"2026-05-01T13:56:00.205+00:00","modifiedAt":"2026-10-19T19:06:06.659+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"net/packet/af_packet.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"0f4c9754956b86de158a4af5278c5cf5bda9439e\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"714aa973da8163925eda7efd49361ccbee21ee46\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"1490f82353bdabc09265a74e645b07f05cf4188e\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"3a1bf9116ea31470b89692585c3910dfe830dcdd\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"28324a3b62d9ce7f9bdd65a8ce63f382041d1b27\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"1d036d25e5609ba73fee6a88db01c306b140d512\",\n                            \"lessThan\": \"2c054e17d9d41f1020376806c7f750834ced4dc5\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"net/packet/af_packet.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"4.6\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"4.6\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.10.259\",\n                            \"lessThanOrEqual\": \"5.10.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.15.210\",\n                            \"lessThanOrEqual\": \"5.15.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.176\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.136\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.12.84\",\n                            \"lessThanOrEqual\": \"6.12.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.18.25\",\n                            \"lessThanOrEqual\": \"6.18.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"7.0.2\",\n                            \"lessThanOrEqual\": \"7.0.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"7.1\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"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,"severity":"HIGH"}],"references":["https://git.kernel.org/stable/c/0f4c9754956b86de158a4af5278c5cf5bda9439e","https://git.kernel.org/stable/c/714aa973da8163925eda7efd49361ccbee21ee46","https://git.kernel.org/stable/c/1490f82353bdabc09265a74e645b07f05cf4188e","https://git.kernel.org/stable/c/74e2db36fe50e3ad9d5300d7fd0e6e2a15a6d121","https://git.kernel.org/stable/c/3a1bf9116ea31470b89692585c3910dfe830dcdd","https://git.kernel.org/stable/c/28324a3b62d9ce7f9bdd65a8ce63f382041d1b27","https://git.kernel.org/stable/c/48a6ef291a17639e1b6ae0fbe9c8b2bb87d7804b","https://git.kernel.org/stable/c/2c054e17d9d41f1020376806c7f750834ced4dc5"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-31700","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-31700","identifiers":["CVE-2026-31700"]},"retained":false,"historicalAffected":[]}],"coverage":[]}