{"id":"CVE-2024-26704","aliases":["CVE-2024-26704"],"related":[],"kind":"vulnerability","state":"published","title":"ext4: fix double-free of blocks due to wrong extents moved_len","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\next4: fix double-free of blocks due to wrong extents moved_len\n\nIn ext4_move_extents(), moved_len is only updated when all moves are\nsuccessfully executed, and only discards orig_inode and donor_inode\npreallocations when moved_len is not zero. When the loop fails to exit\nafter successfully moving some extents, moved_len is not updated and\nremains at 0, so it does not discard the preallocations.\n\nIf the moved extents overlap with the preallocated extents, the\noverlapped extents are freed twice in ext4_mb_release_inode_pa() and\next4_process_freed_data() (as described in commit 94d7c16cbbbd (\"ext4:\nFix double-free of blocks with EXT4_IOC_MOVE_EXT\")), and bb_free is\nincremented twice. Hence when trim is executed, a zero-division bug is\ntriggered in mb_update_avg_fragment_size() because bb_free is not zero\nand bb_fragments is zero.\n\nTherefore, update move_len after each extent move to avoid the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\next4: fix double-free of blocks due to wrong extents moved_len\n\nIn ext4_move_extents(), moved_len is only updated when all moves are\nsuccessfully executed, and only discards orig_inode and donor_inode\npreallocations when moved_len is not zero. When the loop fails to exit\nafter successfully moving some extents, moved_len is not updated and\nremains at 0, so it does not discard the preallocations.\n\nIf the moved extents overlap with the preallocated extents, the\noverlapped extents are freed twice in ext4_mb_release_inode_pa() and\next4_process_freed_data() (as described in commit 94d7c16cbbbd (\"ext4:\nFix double-free of blocks with EXT4_IOC_MOVE_EXT\")), and bb_free is\nincremented twice. Hence when trim is executed, a zero-division bug is\ntriggered in mb_update_avg_fragment_size() because bb_free is not zero\nand bb_fragments is zero.\n\nTherefore, update move_len after each extent move to avoid the issue.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ext4: corrige la doble liberación de bloques debido a extensiones incorrectas. moving_len En ext4_move_extents(), move_len solo se actualiza cuando todos los movimientos se ejecutan exitosamente y solo descarta las preasignaciones de orig_inode y donante_inode cuando se mueve_len no es cero. Cuando el bucle no sale después de mover con éxito algunas extensiones, moving_len no se actualiza y permanece en 0, por lo que no descarta las asignaciones previas. Si las extensiones movidas se superponen con las extensiones preasignadas, las extensiones superpuestas se liberan dos veces en ext4_mb_release_inode_pa() y ext4_process_freed_data() (como se describe en el commit 94d7c16cbbbd (\"ext4: corrige la doble liberación de bloques con EXT4_IOC_MOVE_EXT\")), y se incrementa bb_free dos veces. Por lo tanto, cuando se ejecuta trim, se activa un error de división cero en mb_update_avg_fragment_size() porque bb_free no es cero y bb_fragments es cero. Por lo tanto, actualice move_len después de cada movimiento de extensión para evitar el problema.","source":"nvd"}],"published":"2024-04-03T14:55:02.672Z","modified":"2026-08-05T11:26:47.486Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"b4fbb89d722cbb16beaaea234b7230faaaf68c71","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"afbcad9ae7d6d11608399188f03a837451b6b3a1","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"d033a555d9a1cf53dbf3301af7199cc4a4c8f537","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"afba9d11320dad5ce222ac8964caf64b7b4bedb1","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"2883940b19c38d5884c8626483811acf4d7e148f","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"559ddacb90da1d8786dd8ec4fd76bbfa404eaef6","status":"affected"},{"type":"git","introduced":"fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a","fixed":"55583e899a5357308274601364741a83e78d6ac4","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.18","status":"unaffected"},{"type":"semver","introduced":"4.19.307","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.269","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.210","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.149","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.79","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.18","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.7.6","lastAffected":"6.7.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.8","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":"3.18","fixed":"4.19.307"},{"status":"affected","introduced":"4.20","fixed":"5.4.269"},{"status":"affected","introduced":"5.5","fixed":"5.10.210"},{"status":"affected","introduced":"5.11","fixed":"5.15.149"},{"status":"affected","introduced":"5.16","fixed":"6.1.79"},{"status":"affected","introduced":"6.2","fixed":"6.6.18"},{"status":"affected","introduced":"6.7","fixed":"6.7.6"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"}],"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/b4fbb89d722cbb16beaaea234b7230faaaf68c71","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/afbcad9ae7d6d11608399188f03a837451b6b3a1","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d033a555d9a1cf53dbf3301af7199cc4a4c8f537","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/afba9d11320dad5ce222ac8964caf64b7b4bedb1","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2883940b19c38d5884c8626483811acf4d7e148f","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/559ddacb90da1d8786dd8ec4fd76bbfa404eaef6","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55583e899a5357308274601364741a83e78d6ac4","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://lists.debian.org/debian-lts-announce/2024/06/msg00020.html","tags":["mailing-list","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-10T15:52:39.832Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-26704","url":"https://www.cve.org/CVERecord?id=CVE-2024-26704","licence":"CVE Terms of Use","modified":"2026-08-05T11:26:47.486Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-26704","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26704","licence":"Public domain","modified":"2026-08-04T11:16:57.693Z"}],"updatedAt":"2026-11-25T22:58:38.526Z","epss":{"score":0.00268,"percentile":0.20209,"date":"2026-12-01T12:00:22.000Z"}}