{"id":"CVE-2024-46840","aliases":["CVE-2024-46840"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: clean up our handling of refs == 0 in snapshot delete","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: clean up our handling of refs == 0 in snapshot delete\n\nIn reada we BUG_ON(refs == 0), which could be unkind since we aren't\nholding a lock on the extent leaf and thus could get a transient\nincorrect answer.  In walk_down_proc we also BUG_ON(refs == 0), which\ncould happen if we have extent tree corruption.  Change that to return\n-EUCLEAN.  In do_walk_down() we catch this case and handle it correctly,\nhowever we return -EIO, which -EUCLEAN is a more appropriate error code.\nFinally in walk_up_proc we have the same BUG_ON(refs == 0), so convert\nthat to proper error handling.  Also adjust the error message so we can\nactually do something with the information.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: clean up our handling of refs == 0 in snapshot delete\n\nIn reada we BUG_ON(refs == 0), which could be unkind since we aren't\nholding a lock on the extent leaf and thus could get a transient\nincorrect answer.  In walk_down_proc we also BUG_ON(refs == 0), which\ncould happen if we have extent tree corruption.  Change that to return\n-EUCLEAN.  In do_walk_down() we catch this case and handle it correctly,\nhowever we return -EIO, which -EUCLEAN is a more appropriate error code.\nFinally in walk_up_proc we have the same BUG_ON(refs == 0), so convert\nthat to proper error handling.  Also adjust the error message so we can\nactually do something with the information.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: btrfs: limpia nuestro manejo de refs == 0 en la eliminación de instantáneas En reada tenemos BUG_ON(refs == 0), lo que podría ser desagradable ya que no estamos manteniendo un bloqueo en la hoja de extensión y, por lo tanto, podríamos obtener una respuesta incorrecta transitoria. En walk_down_proc también tenemos BUG_ON(refs == 0), lo que podría suceder si tenemos corrupción del árbol de extensión. Cambia eso para que devuelva -EUCLEAN. En do_walk_down() capturamos este caso y lo manejamos correctamente, sin embargo, devolvemos -EIO, que -EUCLEAN es un código de error más apropiado. Finalmente, en walk_up_proc tenemos el mismo BUG_ON(refs == 0), así que conviértelo en un manejo de errores adecuado. También ajusta el mensaje de error para que podamos hacer algo con la información.","source":"nvd"}],"published":"2024-09-27T12:39:34.998Z","modified":"2026-06-17T07:56:03.540Z","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":[],"affected":[{"ranges":[{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"c847b28a799733b04574060ab9d00f215970627d","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"71291aa7246645ef622621934d2067400380645e","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"c60676b81fab456b672796830f6d8057058f029c","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"728d4d045b628e006b48a448f3326a7194c88d32","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"9cc887ac24b7a0598f4042ae9af6b9a33072f75b","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"7d1df13bf078ffebfedd361d714ff6cee1ff01b9","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"03804641ec2d0da4fa088ad21c88e703d151ce16","status":"affected"},{"type":"git","introduced":"2c47e605a91dde6b0514f689645e7ab336c8592a","fixed":"b8ccef048354074a548f108e51d0557d6adfd3a3","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.31","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.31","status":"unaffected"},{"type":"semver","introduced":"4.19.322","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.284","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.226","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.167","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.110","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.51","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.10.10","lastAffected":"6.10.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.11","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","fixed":"4.19.322"},{"status":"affected","introduced":"4.20","fixed":"5.4.284"},{"status":"affected","introduced":"5.5","fixed":"5.10.226"},{"status":"affected","introduced":"5.11","fixed":"5.15.167"},{"status":"affected","introduced":"5.16","fixed":"6.1.110"},{"status":"affected","introduced":"6.2","fixed":"6.6.51"},{"status":"affected","introduced":"6.7","fixed":"6.10.10"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/c847b28a799733b04574060ab9d00f215970627d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/71291aa7246645ef622621934d2067400380645e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c60676b81fab456b672796830f6d8057058f029c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/728d4d045b628e006b48a448f3326a7194c88d32","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9cc887ac24b7a0598f4042ae9af6b9a33072f75b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7d1df13bf078ffebfedd361d714ff6cee1ff01b9","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/03804641ec2d0da4fa088ad21c88e703d151ce16","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b8ccef048354074a548f108e51d0557d6adfd3a3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-29T13:59:36.735Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-46840","url":"https://www.cve.org/CVERecord?id=CVE-2024-46840","licence":"CVE Terms of Use","modified":"2026-05-11T20:37:33.572Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-46840","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-46840","licence":"Public domain","modified":"2026-06-17T07:56:03.540Z"}],"updatedAt":"2026-11-25T22:58:45.838Z","epss":{"score":0.00316,"percentile":0.16956,"date":"2026-11-30T12:00:22.000Z"}}