CVE-2024-35895
bpf, sockmap: Prevent lock inversion deadlock in map delete elem
Reported by linux · Published May 19, 2024
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Prevent lock inversion deadlock in map delete elem syzkaller started using corpuses where a BPF tracing program deletes elements from a sockmap/sockhash map. Because BPF tracing programs can be invoked from any interrupt context, locks taken during a map_delete_elem operation must be hardirq-safe. Otherwise a deadlock due to lock inversion is possible, as reported by lockdep: CPU0 CPU1 ---- ---- lock(&htab->buckets[i].lock); local_irq_disable(); lock(&host->lock); lock(&htab->buckets[i].lock); <Interrupt> lock(&host->lock); Locks in sockmap are hardirq-unsafe by design. We expects elements to be deleted from sockmap/sockhash only in task (normal) context with interrupts enabled, or in softirq context. Detect when map_delete_elem operation is invoked from a context which is _not_ hardirq-unsafe, that is interrupts are disabled, and bail out with an error. Note that map updates are not affected by this issue. BPF verifier does not allow updating sockmap/sockhash from a BPF tracing program today.
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, 6.1.85, 5.15.154, 5.10.215, 5.4.274 |
| Linux | Linux | ff91059932401894e6c86341915615c5eb0eca48, d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec, 6af057ccdd8e7619960aca1f0428339f213b31cd |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 604326b41a6fb9b4a78b6179335decee0365cd8c, 604326b41a6fb9b4a78b6179335decee0365cd8c, 604326b41a6fb9b4a78b6179335decee0365cd8c |
| Linux | Linux | 4.20, 0, 5.4.274 |
| Linux | Linux | 604326b41a6fb9b4a78b6179335decee0365cd8c, 6.6.26, 604326b41a6fb9b4a78b6179335decee0365cd8c |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-livepatch-6.1.87-99.174 | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-headers | 0 |
| Siemens | SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel | 0 |
| linux | linux_kernel | 4.20, 4.20, 4.20 |
Timeline
- May 19, 2024 CVE Published
- May 20, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (10 in total, the first dated here)
- Jan 10, 2026 Security Advisory (455 in total, the first dated here)
- Mar 30, 2026 Distribution Patch (350 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-35895
vulnetix vdb fixes CVE-2024-35895
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-35895/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart