{"id":"CVE-2026-139326","state":"PUBLISHED","title":"bpf: Use the frame mem type in devmap egress XDP","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Use the frame mem type in devmap egress XDP\n\nA devmap egress program that removes a whole fragment of a redirected\nxdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it\nwith page_frag_free() whatever the frame's memory type is. For a\nMEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the\npage reference owned by the pool while the pool still accounts the\nfragment (\"page_pool leak\" bad page, leaked pp reference).\n\nkernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an\non-stack\n\n    struct xdp_rxq_info rxq = { .dev = rx_dev };\n\nwhose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and\nnet/core/filter.c:bpf_xdp_shrink_data() releases frags according to\nrxq->mem.type. cpumap, which runs programs on xdp_frames the same way,\nalready copies xdpf->mem_type into its private rxq for each frame.\n\nWith 9000 byte frames from virtio_net and an egress program that cuts the\nfragments off:\n\n  BUG: Bad page state in process swapper/3  pfn:10660b\n  page dumped because: page_pool leak\n   bad_page+0xbd/0x190\n   __free_frozen_pages+0x5c7/0x900\n   bpf_xdp_adjust_tail+0x3be/0x480\n   bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd\n   dev_map_bpf_prog_run+0x288/0x610\n\nThe pool waits for these pages for ever when its device is gone. That is\nthe harmless case. A page of the pool can hold more than one fragment\nwhile its refcount is 1: the first page_frag_free() frees it under the\nfragment which is still in use, and the second one runs into\n\n  page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)\n  kernel BUG at include/linux/mm.h:1846!\n\nveth is not affected. It takes references of its own on the pages and\nredirects the frame as MEM_TYPE_PAGE_SHARED.\n\nFix by setting rxq.mem.type from each frame before running the devmap\nprogram, as cpu_map_bpf_prog_run_xdp() does.","publishedAt":"2026-11-30T13:33:43.705Z","updatedAt":"2026-11-30T13:33:43.705Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"55a5ecf8531f57f714925b28c1a1bb4601b224c6","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"42a02f01ec4fb8716ce747c3934d925638ff5c44","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"f014c65f9de79122e818a977af7261127ee0e98c","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"b3ca872947ef322c475ceaa7a76a9ebb3356152e","versionType":"git"},{"version":"fe068afb868660fe683a8391c6c17ecbe2254922","status":"affected","versionType":"git"},{"version":"a778fbe087c19f4ece5f5fc14173328f070c3803","status":"affected","versionType":"git"},{"version":"49454f09936a9a96edfb047156889879cb4001eb","status":"affected","versionType":"git"},{"version":"9167d1c274a336e4763eeb3f3f9cb763c55df5aa","status":"affected","versionType":"git"},{"version":"5.15.170","status":"affected","lessThan":"5.16","versionType":"semver"},{"version":"6.1.115","status":"affected","lessThan":"6.2","versionType":"semver"},{"version":"6.6.59","status":"affected","lessThan":"6.7","versionType":"semver"},{"version":"6.11.6","status":"affected","lessThan":"6.12","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/devmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/devmap.c"]}],"references":["https://git.kernel.org/stable/c/55a5ecf8531f57f714925b28c1a1bb4601b224c6","https://git.kernel.org/stable/c/42a02f01ec4fb8716ce747c3934d925638ff5c44","https://git.kernel.org/stable/c/f014c65f9de79122e818a977af7261127ee0e98c","https://git.kernel.org/stable/c/b3ca872947ef322c475ceaa7a76a9ebb3356152e"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139326.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139326","state":"PUBLISHED","datePublished":"2026-11-30T13:33:43.705Z","dateUpdated":"2026-11-30T13:33:43.705Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.927Z"},"containers":{"cna":{"title":"bpf: Use the frame mem type in devmap egress XDP","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Use the frame mem type in devmap egress XDP\n\nA devmap egress program that removes a whole fragment of a redirected\nxdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it\nwith page_frag_free() whatever the frame's memory type is. For a\nMEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the\npage reference owned by the pool while the pool still accounts the\nfragment (\"page_pool leak\" bad page, leaked pp reference).\n\nkernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an\non-stack\n\n    struct xdp_rxq_info rxq = { .dev = rx_dev };\n\nwhose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and\nnet/core/filter.c:bpf_xdp_shrink_data() releases frags according to\nrxq->mem.type. cpumap, which runs programs on xdp_frames the same way,\nalready copies xdpf->mem_type into its private rxq for each frame.\n\nWith 9000 byte frames from virtio_net and an egress program that cuts the\nfragments off:\n\n  BUG: Bad page state in process swapper/3  pfn:10660b\n  page dumped because: page_pool leak\n   bad_page+0xbd/0x190\n   __free_frozen_pages+0x5c7/0x900\n   bpf_xdp_adjust_tail+0x3be/0x480\n   bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd\n   dev_map_bpf_prog_run+0x288/0x610\n\nThe pool waits for these pages for ever when its device is gone. That is\nthe harmless case. A page of the pool can hold more than one fragment\nwhile its refcount is 1: the first page_frag_free() frees it under the\nfragment which is still in use, and the second one runs into\n\n  page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)\n  kernel BUG at include/linux/mm.h:1846!\n\nveth is not affected. It takes references of its own on the pages and\nredirects the frame as MEM_TYPE_PAGE_SHARED.\n\nFix by setting rxq.mem.type from each frame before running the devmap\nprogram, as cpu_map_bpf_prog_run_xdp() does."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"55a5ecf8531f57f714925b28c1a1bb4601b224c6","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"42a02f01ec4fb8716ce747c3934d925638ff5c44","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"f014c65f9de79122e818a977af7261127ee0e98c","versionType":"git"},{"version":"ca9984c5f0ab3690d98b13937b2485a978c8dd73","status":"affected","lessThan":"b3ca872947ef322c475ceaa7a76a9ebb3356152e","versionType":"git"},{"version":"fe068afb868660fe683a8391c6c17ecbe2254922","status":"affected","versionType":"git"},{"version":"a778fbe087c19f4ece5f5fc14173328f070c3803","status":"affected","versionType":"git"},{"version":"49454f09936a9a96edfb047156889879cb4001eb","status":"affected","versionType":"git"},{"version":"9167d1c274a336e4763eeb3f3f9cb763c55df5aa","status":"affected","versionType":"git"},{"version":"5.15.170","status":"affected","lessThan":"5.16","versionType":"semver"},{"version":"6.1.115","status":"affected","lessThan":"6.2","versionType":"semver"},{"version":"6.6.59","status":"affected","lessThan":"6.7","versionType":"semver"},{"version":"6.11.6","status":"affected","lessThan":"6.12","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/devmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/devmap.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/55a5ecf8531f57f714925b28c1a1bb4601b224c6"},{"url":"https://git.kernel.org/stable/c/42a02f01ec4fb8716ce747c3934d925638ff5c44"},{"url":"https://git.kernel.org/stable/c/f014c65f9de79122e818a977af7261127ee0e98c"},{"url":"https://git.kernel.org/stable/c/b3ca872947ef322c475ceaa7a76a9ebb3356152e"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:43.705Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"7.4-rc1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15.170"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1.115"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.59"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11.6"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}