CVE-2026-139326

bpf: Use the frame mem type in devmap egress XDP

Published Nov 30, 2026 CVSS 3.1 · 8.1 High EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Use the frame mem type in devmap egress XDP

A devmap egress program that removes a whole fragment of a redirected
xdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it
with page_frag_free() whatever the frame's memory type is. For a
MEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the
page reference owned by the pool while the pool still accounts the
fragment ("page_pool leak" bad page, leaked pp reference).

kernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an
on-stack

struct xdp_rxq_info rxq = { .dev = rx_dev };

whose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and
net/core/filter.c:bpf_xdp_shrink_data() releases frags according to
rxq->mem.type. cpumap, which runs programs on xdp_frames the same way,
already copies xdpf->mem_type into its private rxq for each frame.

With 9000 byte frames from virtio_net and an egress program that cuts the
fragments off:

BUG: Bad page state in process swapper/3 pfn:10660b
page dumped because: page_pool leak
bad_page+0xbd/0x190
__free_frozen_pages+0x5c7/0x900
bpf_xdp_adjust_tail+0x3be/0x480
bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd
dev_map_bpf_prog_run+0x288/0x610

The pool waits for these pages for ever when its device is gone. That is
the harmless case. A page of the pool can hold more than one fragment
while its refcount is 1: the first page_frag_free() frees it under the
fragment which is still in use, and the second one runs into

page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
kernel BUG at include/linux/mm.h:1846!

veth is not affected. It takes references of its own on the pages and
redirects the frame as MEM_TYPE_PAGE_SHARED.

Fix by setting rxq.mem.type from each frame before running the devmap
program, as cpu_map_bpf_prog_run_xdp() does.

Analysis

AI-generated

Technical impact

In the Linux kernel, a programming error in the devmap egress XDP pathway can release memory fragments incorrectly, regardless of the fragment's memory type. This bug can cause page pool leaks and trigger kernel panics. The affected logic frees fragments using page_frag_free() even when the memory originates from a page_pool, leading to double‑free situations and corrupted page reference counts. As a result, the kernel may crash, resulting in a denial‑of‑service condition.

Affected Systems

The flaw consists solely in the free‑path of devmap egress XDP programs, so it impacts all Linux kernels that compile the standard networking stack with XDP support. No specific vendor or version range is publicly listed; however, any system running the embedded Linux kernel that allows user‑space BPF programs to attach egress XDP handlers is potentially vulnerable.

Risk and Exploitability

EPSS score is unavailable, and the vulnerability is not listed in CISA's KEV catalog, and the CVSS score is 8.1. The flaw is a memory‑management bug that can be triggered through a crafted XDP program run by an attacker who can author BPF code on the host. The bug can cause page‑pool corruption and a kernel panic, leading to a denial‑of‑service condition. Although there are no public exploitation reports, any compromised kernel will immediately become unusable until the patch is applied.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that contains the fix for the devmap egress XDP memory‑type handling bug.
  • Reboot the affected nodes to load the patched kernel image.
  • Deploy BPF egress programs only after verifying they do not invoke bpf_xdp_adjust_tail() or bpf_xdp_pull_data() with frame fragments unless the kernel is patched.

Generated by OpenCVE AI on December 1, 2026 at 11:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-401
CWE-416
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Use the frame mem type in devmap egress XDP A devmap egress program that removes a whole fragment of a redirected xdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it with page_frag_free() whatever the frame's memory type is. For a MEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the page reference owned by the pool while the pool still accounts the fragment ("page_pool leak" bad page, leaked pp reference). kernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an on-stack struct xdp_rxq_info rxq = { .dev = rx_dev }; whose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and net/core/filter.c:bpf_xdp_shrink_data() releases frags according to rxq->mem.type. cpumap, which runs programs on xdp_frames the same way, already copies xdpf->mem_type into its private rxq for each frame. With 9000 byte frames from virtio_net and an egress program that cuts the fragments off: BUG: Bad page state in process swapper/3 pfn:10660b page dumped because: page_pool leak bad_page+0xbd/0x190 __free_frozen_pages+0x5c7/0x900 bpf_xdp_adjust_tail+0x3be/0x480 bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd dev_map_bpf_prog_run+0x288/0x610 The pool waits for these pages for ever when its device is gone. That is the harmless case. A page of the pool can hold more than one fragment while its refcount is 1: the first page_frag_free() frees it under the fragment which is still in use, and the second one runs into page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) kernel BUG at include/linux/mm.h:1846! veth is not affected. It takes references of its own on the pages and redirects the frame as MEM_TYPE_PAGE_SHARED. Fix by setting rxq.mem.type from each frame before running the devmap program, as cpu_map_bpf_prog_run_xdp() does.
Title bpf: Use the frame mem type in devmap egress XDP
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

  • CWE-416

    Use After Free

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Dec 1, 2026, 5:42 AM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Dec 1, 2026, 6:17 AM