{"id":"CVE-2024-35895","aliases":["CVE-2024-35895"],"related":[],"kind":"vulnerability","state":"published","title":"bpf, sockmap: Prevent lock inversion deadlock in map delete elem","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, sockmap: Prevent lock inversion deadlock in map delete elem\n\nsyzkaller started using corpuses where a BPF tracing program deletes\nelements from a sockmap/sockhash map. Because BPF tracing programs can be\ninvoked from any interrupt context, locks taken during a map_delete_elem\noperation must be hardirq-safe. Otherwise a deadlock due to lock inversion\nis possible, as reported by lockdep:\n\n       CPU0                    CPU1\n       ----                    ----\n  lock(&htab->buckets[i].lock);\n                               local_irq_disable();\n                               lock(&host->lock);\n                               lock(&htab->buckets[i].lock);\n  <Interrupt>\n    lock(&host->lock);\n\nLocks in sockmap are hardirq-unsafe by design. We expects elements to be\ndeleted from sockmap/sockhash only in task (normal) context with interrupts\nenabled, or in softirq context.\n\nDetect when map_delete_elem operation is invoked from a context which is\n_not_ hardirq-unsafe, that is interrupts are disabled, and bail out with an\nerror.\n\nNote that map updates are not affected by this issue. BPF verifier does not\nallow updating sockmap/sockhash from a BPF tracing program today.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, sockmap: Prevent lock inversion deadlock in map delete elem\n\nsyzkaller started using corpuses where a BPF tracing program deletes\nelements from a sockmap/sockhash map. Because BPF tracing programs can be\ninvoked from any interrupt context, locks taken during a map_delete_elem\noperation must be hardirq-safe. Otherwise a deadlock due to lock inversion\nis possible, as reported by lockdep:\n\n       CPU0                    CPU1\n       ----                    ----\n  lock(&htab->buckets[i].lock);\n                               local_irq_disable();\n                               lock(&host->lock);\n                               lock(&htab->buckets[i].lock);\n  <Interrupt>\n    lock(&host->lock);\n\nLocks in sockmap are hardirq-unsafe by design. We expects elements to be\ndeleted from sockmap/sockhash only in task (normal) context with interrupts\nenabled, or in softirq context.\n\nDetect when map_delete_elem operation is invoked from a context which is\n_not_ hardirq-unsafe, that is interrupts are disabled, and bail out with an\nerror.\n\nNote that map updates are not affected by this issue. BPF verifier does not\nallow updating sockmap/sockhash from a BPF tracing program today.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf, sockmap: Evitar el punto muerto de inversión de bloqueo en la eliminación del mapa elem syzkaller comenzó a usar corpus donde un programa de seguimiento BPF elimina elementos de un mapa sockmap/sockhash. Debido a que los programas de seguimiento BPF se pueden invocar desde cualquier contexto de interrupción, los bloqueos realizados durante una operación map_delete_elem deben ser seguros. De lo contrario, es posible que se produzca un punto muerto debido a la inversión del bloqueo, como lo informa lockdep: CPU0 CPU1 ---- ---- lock(&amp;htab-&gt;buckets[i].lock); local_irq_disable(); bloquear(&amp;host-&gt;bloquear); lock(&amp;htab-&gt;cubos[i].lock);  bloqueo(&amp;host-&gt;bloqueo); Los bloqueos en sockmap son difíciles de inseguro por diseño. Esperamos que los elementos se eliminen de sockmap/sockhash solo en el contexto de la tarea (normal) con las interrupciones habilitadas o en el contexto de softirq. Detecta cuándo se invoca la operación map_delete_elem desde un contexto que _no_ es hardirq-inseguro, es decir, las interrupciones están deshabilitadas y sale con un error. Tenga en cuenta que las actualizaciones de mapas no se ven afectadas por este problema. El verificador de BPF no permite actualizar sockmap/sockhash desde un programa de seguimiento de BPF en la actualidad.","source":"nvd"}],"published":"2024-05-19T08:34:50.276Z","modified":"2026-10-15T01:17:50.647Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-667"],"affected":[{"ranges":[{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"f7990498b05ac41f7d6a190dc0418ef1d21bf058","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"dd54b48db0c822ae7b520bc80751f0a0a173ef75","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"a44770fed86515eedb5a7c00b787f847ebb134a5","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"668b3074aa14829e2ac2759799537a93b60fef86","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"6af057ccdd8e7619960aca1f0428339f213b31cd","status":"affected"},{"type":"git","introduced":"604326b41a6fb9b4a78b6179335decee0365cd8c","fixed":"ff91059932401894e6c86341915615c5eb0eca48","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.20","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.20","status":"unaffected"},{"type":"semver","introduced":"5.4.274","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.215","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.154","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.85","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.26","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.8.5","lastAffected":"6.8.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.9","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.20","fixed":"5.4.274"},{"status":"affected","introduced":"5.5","fixed":"5.10.215"},{"status":"affected","introduced":"5.11","fixed":"5.15.154"},{"status":"affected","introduced":"5.16","fixed":"6.1.85"},{"status":"affected","introduced":"6.2","fixed":"6.6.26"},{"status":"affected","introduced":"6.7","fixed":"6.8.5"},{"status":"affected","version":"6.9"},{"status":"affected","version":"6.9"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f7990498b05ac41f7d6a190dc0418ef1d21bf058","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/dd54b48db0c822ae7b520bc80751f0a0a173ef75","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d1e73fb19a4c872d7a399ad3c66e8ca30e0875ec","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a44770fed86515eedb5a7c00b787f847ebb134a5","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/668b3074aa14829e2ac2759799537a93b60fef86","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6af057ccdd8e7619960aca1f0428339f213b31cd","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ff91059932401894e6c86341915615c5eb0eca48","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html","tags":["mailing-list","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-23T19:25:39.256Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-35895","url":"https://www.cve.org/CVERecord?id=CVE-2024-35895","licence":"CVE Terms of Use","modified":"2026-10-15T00:41:12.685Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-35895","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35895","licence":"Public domain","modified":"2026-10-15T01:17:50.647Z"}],"updatedAt":"2026-11-25T22:58:40.588Z","epss":{"score":0.0018,"percentile":0.07968,"date":"2026-12-01T12:00:22.000Z"}}