VDB

CVE-2024-35895

CVE-2024-35895 PUBLISHED

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.

PackageEcosystemFixed in
linux_kernellinux6.8.5, 6.6.26, 6.1.85, 5.15.154, 5.10.215, 5.4.274
LinuxLinuxff91059932401894e6c86341915615c5eb0eca48, d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec, 6af057ccdd8e7619960aca1f0428339f213b31cd

Affected products

VendorProductVersions
LinuxLinux604326b41a6fb9b4a78b6179335decee0365cd8c, 604326b41a6fb9b4a78b6179335decee0365cd8c, 604326b41a6fb9b4a78b6179335decee0365cd8c
LinuxLinux4.20, 0, 5.4.274
LinuxLinux604326b41a6fb9b4a78b6179335decee0365cd8c, 6.6.26, 604326b41a6fb9b4a78b6179335decee0365cd8c
amazon:2023kernel-tools-devel0
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-livepatch-6.1.87-99.1740
amazon:2023python3-perf0
amazon:2023kernel-devel0
amazon:2023bpftool0
amazon:2023kernel-libbpf-static0
amazon:2023kernel-tools0
amazon:2023kernel-modules-extra-common0
amazon:2023kernel-headers0
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystem0
amazon:2023perf0
amazon:2023kernel-modules-extra0
amazon:2023kernel-libbpf0
amazon:2023kernel0
linuxlinux_kernel4.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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›