{"id":"CVE-2026-139326","summary":"bpf: Use the frame mem type in devmap egress XDP","details":"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-\u003emem.type. cpumap, which runs programs on xdp_frames the same way,\nalready copies xdpf-\u003emem_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.","modified":"2026-12-01T07:00:35.969865731Z","published":"2026-11-30T13:33:43.705Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139326.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/42a02f01ec4fb8716ce747c3934d925638ff5c44"},{"type":"WEB","url":"https://git.kernel.org/stable/c/55a5ecf8531f57f714925b28c1a1bb4601b224c6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b3ca872947ef322c475ceaa7a76a9ebb3356152e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f014c65f9de79122e818a977af7261127ee0e98c"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139326.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139326"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ca9984c5f0ab3690d98b13937b2485a978c8dd73"},{"fixed":"55a5ecf8531f57f714925b28c1a1bb4601b224c6"},{"fixed":"42a02f01ec4fb8716ce747c3934d925638ff5c44"},{"fixed":"f014c65f9de79122e818a977af7261127ee0e98c"},{"fixed":"b3ca872947ef322c475ceaa7a76a9ebb3356152e"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"fe068afb868660fe683a8391c6c17ecbe2254922"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"a778fbe087c19f4ece5f5fc14173328f070c3803"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"49454f09936a9a96edfb047156889879cb4001eb"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"9167d1c274a336e4763eeb3f3f9cb763c55df5aa"}]}],"versions":["v5.15.226","v5.15.225","v5.15.224","v5.15.223","v5.15.222","v5.15.221","v5.15.220","v5.15.219","v5.15.218","v5.15.217","v5.15.216","v5.15.215","v5.15.214","v5.15.213","v5.15.212","v5.15.211","v5.15.210","v5.15.209","v5.15.208","v5.15.207","v5.15.206","v5.15.205","v5.15.204","v5.15.203","v5.15.202","v5.15.201","v5.15.200","v5.15.199","v5.15.198","v5.15.197","v5.15.196","v5.15.195","v5.15.194","v5.15.193","v5.15.192","v5.15.191","v5.15.190","v5.15.189","v5.15.188","v5.15.187","v5.15.186","v5.15.185","v5.15.184","v5.15.183","v5.15.182","v5.15.181","v5.15.180","v5.15.179","v5.15.178","v5.15.177","v5.15.176","v5.15.175","v5.15.174","v5.15.173","v5.15.172","v5.15.171","v5.15.170","v6.1.193","v6.1.192","v6.1.191","v6.1.190","v6.1.189","v6.1.188","v6.1.187","v6.1.186","v6.1.185","v6.1.184","v6.1.183","v6.1.182","v6.1.181","v6.1.180","v6.1.179","v6.1.178","v6.1.177","v6.1.176","v6.1.175","v6.1.174","v6.1.173","v6.1.172","v6.1.171","v6.1.170","v6.1.169","v6.1.168","v6.1.167","v6.1.166","v6.1.165","v6.1.164","v6.1.163","v6.1.162","v6.1.161","v6.1.160","v6.1.159","v6.1.158","v6.1.157","v6.1.156","v6.1.155","v6.1.154","v6.1.153","v6.1.152","v6.1.151","v6.1.150","v6.1.149","v6.1.148","v6.1.147","v6.1.146","v6.1.145","v6.1.144","v6.1.143","v6.1.142","v6.1.141","v6.1.140","v6.1.139","v6.1.138","v6.1.137","v6.1.136","v6.1.135","v6.1.134","v6.1.133","v6.1.132","v6.1.131","v6.1.130","v6.1.129","v6.1.128","v6.1.127","v6.1.126","v6.1.125","v6.1.124","v6.1.123","v6.1.122","v6.1.121","v6.1.120","v6.1.119","v6.1.118","v6.1.117","v6.1.116","v6.1.115","v6.6.163","v6.6.162","v6.6.161","v6.6.160","v6.6.159","v6.6.158","v6.6.157","v6.6.156","v6.6.155","v6.6.154","v6.6.153","v6.6.152","v6.6.151","v6.6.150","v6.6.149","v6.6.148","v6.6.147","v6.6.146","v6.6.145","v6.6.144","v6.6.143","v6.6.142","v6.6.141","v6.6.140","v6.6.139","v6.6.138","v6.6.137","v6.6.136","v6.6.135","v6.6.134","v6.6.133","v6.6.132","v6.6.131","v6.6.130","v6.6.129","v6.6.128","v6.6.127","v6.6.126","v6.6.125","v6.6.124","v6.6.123","v6.6.122","v6.6.121","v6.6.120","v6.6.119","v6.6.118","v6.6.117","v6.6.116","v6.6.115","v6.6.114","v6.6.113","v6.6.112","v6.6.111","v6.6.110","v6.6.109","v6.6.108","v6.6.107","v6.6.106","v6.6.105","v6.6.104","v6.6.103","v6.6.102","v6.6.101","v6.6.100","v6.6.99","v6.6.98","v6.6.97","v6.6.96","v6.6.95","v6.6.94","v6.6.93","v6.6.92","v6.6.91","v6.6.90","v6.6.89","v6.6.88","v6.6.87","v6.6.86","v6.6.85","v6.6.84","v6.6.83","v6.6.82","v6.6.81","v6.6.80","v6.6.79","v6.6.78","v6.6.77","v6.6.76","v6.6.75","v6.6.74","v6.6.73","v6.6.72","v6.6.71","v6.6.70","v6.6.69","v6.6.68","v6.6.67","v6.6.66","v6.6.65","v6.6.64","v6.6.63","v6.6.62","v6.6.61","v6.6.60","v6.6.59","v6.11.11","v6.11.10","v6.11.9","v6.11.8","v6.11.7","v6.11.6"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139326.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.15.170"},{"fixed":"5.16"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.1.115"},{"fixed":"6.2"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.6.59"},{"fixed":"6.7"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.11.6"},{"fixed":"6.12"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.12.0"},{"fixed":"6.12.120"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.65"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139326.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}