CVE-2024-35860: bpf: support deferring bpf_link dealloc to after RCU grace period

Published May 19, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

bpf: support deferring bpflink 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 bpflink refcnt drops to zero there could still be active BPF programs running accessing link data.

This patch adds generic support to defer bpflink 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, bpflinkfree() will schedule deallocdeferred() 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. bpflinkfree() 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 rcutraceimpliesrcugp() 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 rawtp link to use deferred dealloc callback, as upcoming changes in bpf-next tree expose rawtp link data (specifically, cookie value) to BPF program at runtime as well.

Affected Software

5 affected componentsFixes available
debian/linux<=6.1.129-1, <=6.1.135-1
5.10.223-15.10.234-16.12.25-16.12.27-1
Linux Linux kernel>=5.18<6.6.26
Linux Linux kernel>=6.7<6.8.5
Linux Linux kernel=6.9-rc1
Linux Linux kernel=6.9-rc2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.12.25-1Fixed in 6.12.27-1

Event History

May 19, 2024
CVE Published
via MITRE·08:34 AM
Data Sourced
via MITRE·08:34 AM
DescriptionSeverity
Data Sourced
via NVD·09:15 AM
Description
Data Sourced
via NVD·09:15 AM
RemedySeverityAffected Software
Jul 11, 2024
Data Sourced
via Launchpad·07:46 PM
Description
Dec 2, 2024
Data Sourced
via Ubuntu·08:17 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35860?

CVE-2024-35860 has a moderate severity rating due to potential implications for BPF programs in the Linux kernel.

2

How do I fix CVE-2024-35860?

To fix CVE-2024-35860, update your Linux kernel to version 5.10.223-1, 5.10.226-1, 6.12.9-1, or 6.12.10-1.

3

Which Linux kernel versions are affected by CVE-2024-35860?

CVE-2024-35860 affects Linux kernel versions up to 6.1.123-1 and below, including 6.1.119-1.

4

Is CVE-2024-35860 a remote exploit?

CVE-2024-35860 is not a remote exploit; it impacts local program execution in the Linux kernel.

5

What components are involved in CVE-2024-35860?

CVE-2024-35860 involves BPF link handling within the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203