LiveActive security incident?Get immediate response
CVE Record

CVE-2025-40123: bpf: Enforce expected_attach_type for tailcall compatibility

In the Linux kernel, the following vulnerability has been resolved: bpf: Enforce expected_attach_type for tailcall compatibility Yinhao et al. recently reported: Our fuzzer tool discovered an uninitialized pointer issue in the bpf_prog_test_run_xdp() function within the Linux kernel's BPF subsystem. This leads to a NULL pointer dereference when a BPF program attempts to deference the txq member of struct xdp_buff object. The test initializes two programs of BPF_PROG_TYPE_XDP: progA acts as the entry point for bpf_prog_test_run_xdp() and its expected_attach_type can neither be of be BPF_XDP_DEVMAP nor BPF_XDP_CPUMAP. progA calls into a slot of a tailcall map it owns. progB's expected_attach_type must be BPF_XDP_DEVMAP to pass xdp_is_valid_access() validation. The program returns struct xdp_md's egress_ifindex, and the latter is only allowed to be accessed under mentioned expected_attach_type. progB is then inserted into the tailcall which progA calls. The underlying issue goes beyond XDP though. Another example are programs of type BPF_PROG_TYPE_CGROUP_SOCK_ADDR. sock_addr_is_valid_access() as well as sock_addr_func_proto() have different logic depending on the programs' expected_attach_type. Similarly, a program attached to BPF_CGROUP_INET4_GETPEERNAME should not be allowed doing a tailcall into a program which calls bpf_bind() out of BPF which is only enabled for BPF_CGROUP_INET4_CONNECT. In short, specifying expected_attach_type allows to open up additional functionality or restrictions beyond what the basic bpf_prog_type enables. The use of tailcalls must not violate these constraints. Fix it by enforcing expected_attach_type in __bpf_prog_map_compatible(). Note that we only enforce this for tailcall maps, but not for BPF devmaps or cpumaps: There, the programs are invoked through dev_map_bpf_prog_run*() and cpu_map_bpf_prog_run*() which set up a new environment / context and therefore these situations are not prone to this issue.

HighCVSS 7.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A Linux kernel BPF flaw allows incompatible programs to be joined through a tail call, bypassing restrictions tied to their intended attachment context. A local, low-privileged attacker could potentially cause serious confidentiality, integrity, or availability impact. The documented trigger includes a kernel NULL-pointer dereference, but the supplied sources do not establish remote exploitation or code execution.

Executive priority

Prioritize internet-facing multi-user hosts, container platforms, and other systems where untrusted local workloads may interact with BPF. Treat remediation as high priority, while recognizing that the supplied evidence requires local access and does not show active exploitation. Validate vendor backports promptly because the bundle’s affected-version data is not sufficiently clear for version-only decisions.

Technical view

BPF tail-call compatibility checked program type but failed to enforce expected_attach_type. This could let a program execute with access or helpers permitted only in another attachment context, including XDP and cgroup socket-address cases. The fix adds expected_attach_type enforcement to __bpf_prog_map_compatible(). Devmap and cpumap execution paths are explicitly excluded because they establish a new context.

Likely exposure

Exposure is limited to Linux systems running affected kernels where an attacker can locally create or manipulate relevant BPF programs and tail-call maps. The bundle lists several affected releases, but its version representation includes an ambiguous “0” entry and does not clearly express complete ranges. Confirm exposure through distribution-specific kernel advisories and backport records.

Exploitation context

The issue was discovered by fuzzing and has a local, low-complexity, low-privilege CVSS vector with no user interaction. The supplied KEV indicator is false, and no cited source establishes active exploitation. The documented failure is a NULL-pointer dereference; broader impact is reflected by the 7.8 CVSS score, but practical exploitation details remain unconfirmed.

Researcher notes

The central invariant is that tail-call map compatibility must preserve expected_attach_type restrictions, not merely bpf_prog_type compatibility. Examples cover XDP context-sensitive fields and cgroup socket-address helper availability. Devmaps and cpumaps are not considered vulnerable through this path. Sources establish the bug and fix design but do not provide a complete affected-range interpretation or evidence of weaponized exploitation.

Mitigation direction

  • Upgrade to a vendor-supported kernel containing the expected_attach_type tail-call compatibility fix.
  • Check distribution advisories for backports rather than relying only on upstream version numbers.
  • Restrict untrusted local access and BPF program-management capabilities until affected systems are updated.
  • Follow vendor guidance if immediate kernel replacement is operationally impractical.

Validation and detection

  • Record each system’s running kernel release and distribution package version.
  • Verify vendor changelogs or source packages include one of the referenced stable fixes.
  • Inventory environments allowing local users or workloads to manage BPF programs and tail-call maps.
  • Confirm the updated kernel is active after reboot, not merely installed.
  • Use authorized, non-destructive regression testing to confirm incompatible tail calls are rejected.
Prepared
Confidence
medium
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cve · low confidence lookup

CVE-2025-40123 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
3Timeline events
0ADP providers
6Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H1.85.9Linux

Vulnerability scoring details

Base CVSS 3.1 score

7.8High
CVSS 3.1 vector shape for CVE-2025-40123Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LinuxLinux5e43f899b03a3492ce5fc44e8900becb04dae9c0, 5e43f899b03a3492ce5fc44e8900becb04dae9c0, 5e43f899b03a3492ce5fc44e8900becb04dae9c0, 5e43f899b03a3492ce5fc44e8900becb04dae9c0, 5e43f899b03a3492ce5fc44e8900becb04dae9c0unaffected
LinuxLinux4.17, 0, 6.1.156, 6.6.112, 6.12.53, 6.17.3, 6.18affected
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.