bpf, sockmap: Prevent lock inversion deadlock in map delete elem

Summary

CVECVE-2024-35895
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2024-05-19 09:15:10 UTC
Updated2026-05-12 12:16:39 UTC
DescriptionIn 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.

Risk And Classification

Primary CVSS: v3.1 5.5 MEDIUM from [email protected]

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Problem Types: CWE-667

CVSS v3.1 Breakdown

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Operating System Linux Linux Kernel All All All All

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c f7990498b05ac41f7d6a190dc0418ef1d21bf058 git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c dd54b48db0c822ae7b520bc80751f0a0a173ef75 git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c a44770fed86515eedb5a7c00b787f847ebb134a5 git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c 668b3074aa14829e2ac2759799537a93b60fef86 git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c 6af057ccdd8e7619960aca1f0428339f213b31cd git Not specified
CNA Linux Linux affected 604326b41a6fb9b4a78b6179335decee0365cd8c ff91059932401894e6c86341915615c5eb0eca48 git Not specified
CNA Linux Linux affected 4.20 Not specified
CNA Linux Linux unaffected 4.20 semver Not specified
CNA Linux Linux unaffected 5.4.274 5.4.* semver Not specified
CNA Linux Linux unaffected 5.10.215 5.10.* semver Not specified
CNA Linux Linux unaffected 5.15.154 5.15.* semver Not specified
CNA Linux Linux unaffected 6.1.85 6.1.* semver Not specified
CNA Linux Linux unaffected 6.6.26 6.6.* semver Not specified
CNA Linux Linux unaffected 6.8.5 6.8.* semver Not specified
CNA Linux Linux unaffected 6.9 * original_commit_for_fix Not specified
ADP Siemens SIMATIC S7-1500 TM MFP - GNU/Linux Subsystem affected * custom Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/6af057ccdd8e7619960aca1f0428339f213b31cd af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
lists.debian.org/debian-lts-announce/2024/06/msg00017.html af854a3a-2127-422b-91ae-364da2661108 lists.debian.org Mailing List
git.kernel.org/stable/c/f7990498b05ac41f7d6a190dc0418ef1d21bf058 af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
git.kernel.org/stable/c/668b3074aa14829e2ac2759799537a93b60fef86 af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
git.kernel.org/stable/c/ff91059932401894e6c86341915615c5eb0eca48 af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
cert-portal.siemens.com/productcert/html/ssa-265688.html 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e cert-portal.siemens.com
git.kernel.org/stable/c/a44770fed86515eedb5a7c00b787f847ebb134a5 af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
git.kernel.org/stable/c/d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
git.kernel.org/stable/c/dd54b48db0c822ae7b520bc80751f0a0a173ef75 af854a3a-2127-422b-91ae-364da2661108 git.kernel.org Patch
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report