CVE-2024-35860: bpf: support deferring bpf_link dealloc to after RCU grace period
In the Linux kernel, the following vulnerability has been resolved:
bpf: support deferring bpf_link dealloc to after RCU grace period
BPF link for some program types is passed as a "context" which can be
used by those BPF programs to look up additional information. E.g., for
multi-kprobes and multi-uprobes, link is used to fetch BPF cookie values.
Because of this runtime dependency, when bpf_link refcnt drops to zero
there could still be active BPF programs running accessing link data.
This patch adds generic support to defer bpf_link dealloc callback to
after RCU GP, if requested. This is done by exposing two different
deallocation callbacks, one synchronous and one deferred. If deferred
one is provided, bpf_link_free() will schedule dealloc_deferred()
callback to happen after RCU GP.
BPF is using two flavors of RCU: "classic" non-sleepable one and RCU
tasks trace one. The latter is used when sleepable BPF programs are
used. bpf_link_free() accommodates that by checking underlying BPF
program's sleepable flag, and goes either through normal RCU GP only for
non-sleepable, or through RCU tasks trace GP *and* then normal RCU GP
(taking into account rcu_trace_implies_rcu_gp() optimization), if BPF
program is sleepable.
We use this for multi-kprobe and multi-uprobe links, which dereference
link during program run. We also preventively switch raw_tp link to use
deferred dealloc callback, as upcoming changes in bpf-next tree expose
raw_tp link data (specifically, cookie value) to BPF program at runtime
as well.
Security readout for executives and security teams
Plain-English summary
A Linux kernel lifetime-management flaw can free a BPF link while a BPF program is still using its data. A local, low-privileged attacker could potentially compromise confidentiality, integrity, or availability. Exposure depends on the active kernel build and access to affected BPF functionality.
Executive priority
Treat this as a high-priority local privilege-boundary issue. Expedite assessment and patching on shared Linux systems, developer platforms, and hosts running less-trusted workloads. Internet reachability alone does not determine exposure because exploitation requires local access.
Technical view
Affected multi-kprobe and multi-uprobe BPF programs may dereference link data after the link reference count reaches zero. The correction defers link deallocation until the appropriate RCU grace periods complete, including tasks-trace RCU for sleepable programs. Raw tracepoint links were also changed preventively.
Likely exposure
The supplied record identifies Linux kernel entries including 5.18, 6.6.26, 6.8.5, and 6.9 as affected. Its version data is ambiguous and includes an anomalous "0" entry, so organizations should map their exact kernel or distribution build to vendor guidance and the referenced fixes.
Exploitation context
The CVSS vector describes local access, low attack complexity, low privileges, and no user interaction. The supplied record is not marked as CISA KEV, and the sources provide no evidence of active exploitation. Absence from KEV does not prove exploitation has never occurred.
Researcher notes
The core issue is a race between bpf_link destruction and programs retaining a runtime dependency on link data, such as cookie values. The fix introduces synchronous and deferred deallocation callbacks and selects RCU sequencing based on whether the program is sleepable. The supplied material does not identify a CWE or demonstrate exploitability.
Mitigation direction
Apply a vendor-supported kernel containing the deferred bpf_link deallocation correction.
Prioritize multi-user hosts and systems allowing less-trusted workloads to access BPF.
Restrict unnecessary BPF access for untrusted local users while awaiting an update.
Follow distribution guidance when source-version mapping is unclear.
Validation and detection
Record the running kernel build, not only the installed package version.
Compare that build with distribution advisories and the referenced stable-kernel fixes.
Confirm the corrected kernel is active after maintenance or reboot.
Review whether untrusted users or workloads can access affected BPF program types.
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-35860 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.
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.