Skip to main content
Meet us at Black Hat USA 2026— Las Vegas, August 1–6Book a Meeting
Mallory
Low

Linux kernel BPF tailcall expected_attach_type enforcement flaw

IdentifiersCVE-2025-40123CWE-476

CVE-2025-40123 is a flaw in the Linux kernel BPF subsystem caused by insufficient compatibility checks for BPF tail calls. Specifically, tailcall map compatibility validation did not enforce matching expected_attach_type constraints in __bpf_prog_map_compatible(). As a result, a BPF program could tail-call into another program of the same base bpf_prog_type but with a different expected_attach_type, bypassing attach-type-specific access restrictions and assumptions.

The reported manifestation involved bpf_prog_test_run_xdp(), where a fuzzer found an uninitialized pointer issue leading to a NULL pointer dereference when a BPF program dereferenced the txq member of struct xdp_buff. In the described XDP case, progA was used as the entry program and could not itself have expected_attach_type BPF_XDP_DEVMAP or BPF_XDP_CPUMAP, but it tail-called progB through a tailcall map. ProgB required expected_attach_type BPF_XDP_DEVMAP to pass xdp_is_valid_access() validation and accessed xdp_md.egress_ifindex, which is only valid under that attach type. Because tailcall compatibility did not enforce expected_attach_type, the kernel allowed an invalid execution context to reach code that assumed a different environment.

The issue is broader than XDP. Other BPF program types, including BPF_PROG_TYPE_CGROUP_SOCK_ADDR, also vary permitted helpers and field access based on expected_attach_type. This means tail calls could cross attach-type boundaries and violate intended restrictions or assumptions. The fix was to enforce expected_attach_type for tailcall maps in __bpf_prog_map_compatible(). The change explicitly does not apply to BPF devmaps or cpumaps because those execution paths establish a new execution environment and are not affected in the same way.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can crash the kernel via NULL pointer dereference, producing a denial-of-service / availability impact. The provided scoring and description indicate the primary impact is availability loss rather than confidentiality or integrity compromise. More generally, the flaw allows attach-type-specific BPF restrictions to be bypassed across tail calls, enabling execution of a BPF program under an incompatible context and potentially exposing helper access or metadata access that should not be reachable from the original program context.

Mitigation

If you can’t patch tonight, do this now.

Until patched, reduce exposure by restricting the ability to load or test BPF programs to trusted privileged users only, since exploitation requires local access and low privileges in the vendor scoring context. Minimize access to BPF functionality where operationally feasible, and avoid allowing untrusted users to create or manipulate BPF tailcall maps and related programs. These are compensating controls only; the definitive mitigation is to deploy a fixed kernel.

Remediation

Patch, then assume compromise.

Apply a Linux kernel version containing the fix for CVE-2025-40123, which enforces expected_attach_type during tailcall compatibility checks in __bpf_prog_map_compatible(). Vendor kernel updates from SUSE include this fix across multiple product lines. Follow vendor guidance to install the updated kernel packages and reboot affected systems after patching.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

ACTIVITY FEED

Recent activity

9 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.

No news coverage yet. Advisories and community discussion only.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity2

Community discussion across Reddit, Mastodon, and other social sources.