CVE-2024-47794: bpf: Prevent tailcall infinite loop caused by freplace
In the Linux kernel, the following vulnerability has been resolved:
bpf: Prevent tailcall infinite loop caused by freplace
There is a potential infinite loop issue that can occur when using a
combination of tail calls and freplace.
In an upcoming selftest, the attach target for entry_freplace of
tailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in
entry_freplace leads to entry_tc. This results in an infinite loop:
entry_tc -> subprog_tc -> entry_freplace --tailcall-> entry_tc.
The problem arises because the tail_call_cnt in entry_freplace resets to
zero each time entry_freplace is executed, causing the tail call mechanism
to never terminate, eventually leading to a kernel panic.
To fix this issue, the solution is twofold:
1. Prevent updating a program extended by an freplace program to a
prog_array map.
2. Prevent extending a program that is already part of a prog_array map
with an freplace program.
This ensures that:
* If a program or its subprogram has been extended by an freplace program,
it can no longer be updated to a prog_array map.
* If a program has been added to a prog_array map, neither it nor its
subprograms can be extended by an freplace program.
Moreover, an extension program should not be tailcalled. As such, return
-EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a
prog_array map.
Additionally, fix a minor code style issue by replacing eight spaces with a
tab for proper formatting.
Security readout for executives and security teams
Plain-English summary
A local, low-privileged user may be able to combine Linux BPF features in a way that repeatedly loops inside the kernel and ultimately causes a kernel panic. This can disrupt the affected host. The supplied record rates the issue high severity with CVSS 7.8, but provides no evidence of exploitation in the wild.
Executive priority
Treat as a high-priority availability risk for multi-user, shared, or otherwise locally accessible Linux systems. Patch through supported kernel channels after compatibility testing. Internet exposure alone does not establish vulnerability because the documented attack vector is local.
Technical view
BPF tail calls and freplace programs can create a cycle because the tail-call counter resets whenever the freplace entry executes. The loop can continue until the kernel panics. The fix prevents incompatible freplace and prog_array relationships and rejects BPF_PROG_TYPE_EXT programs added to prog_array maps.
Likely exposure
Exposure requires an affected Linux kernel and local, low-privileged access capable of arranging the relevant BPF programs, freplace attachment, tail calls, and program-array membership. The supplied version data identifies Linux from 5.6 and lists 6.12.5 and 6.13, but its precise range boundaries are ambiguous; confirm status through the kernel or distribution vendor.
Exploitation context
The CVSS vector is local, low complexity, low privileges, and no user interaction. The described outcome is an infinite loop leading to kernel panic. The source bundle marks this CVE as absent from KEV and provides no cited evidence of active exploitation or public weaponization.
Researcher notes
The core invariant is that freplace extension relationships and prog_array membership must not combine to reset tail-call accounting. The record also requires rejecting extension programs placed directly in prog_array maps. Supplied version metadata is internally difficult to interpret, so commit-level or distribution backport verification is more reliable than version-string matching alone.
Mitigation direction
Apply vendor-supported kernel updates containing the referenced upstream or stable fixes.
Confirm distribution backports rather than relying only on displayed kernel version numbers.
Prioritize systems allowing untrusted local users or access to relevant BPF functionality.
Until patched, restrict untrusted local access where operationally practical.
Consult the Linux or distribution vendor if affected-version status remains unclear.
Validation and detection
Inventory running kernel versions across Linux hosts.
Compare each kernel build against distribution advisories and backport records.
Verify the installed kernel contains the applicable referenced fix.
Confirm hosts rebooted into the corrected kernel after updating.
Avoid reproducing the panic condition on production systems.
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-2024-47794 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
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
3Source 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.