CVE-2024-35860
bpf: support deferring bpf_link dealloc to after RCU grace period
Reported by linux · Published May 19, 2024
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| linux_kernel | linux | 6.8.5, 6.6.26 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 0dcac272540613d41c05e89679e4ddb978b612f1, 0dcac272540613d41c05e89679e4ddb978b612f1, 0dcac272540613d41c05e89679e4ddb978b612f1 |
| Linux | Linux | 5.18, 0, 6.1.191 |
| linux | linux_kernel | 5.18, 5.18, 5.18 |
| Linux | Linux | 0dcac272540613d41c05e89679e4ddb978b612f1, 0dcac272540613d41c05e89679e4ddb978b612f1, 0dcac272540613d41c05e89679e4ddb978b612f1 |
Timeline
- May 19, 2024 CVE Published
- May 20, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (7 in total, the first dated here)
- Jan 10, 2026 Security Advisory (436 in total, the first dated here)
- Mar 30, 2026 Distribution Patch (331 in total, the first dated here)
- Oct 30, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-35860
vulnetix vdb fixes CVE-2024-35860
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-35860/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart