Vulnerability · Published Apr 3, 2024 · Assigned by Linux

CVE-2024-26704ext4: fix double-free of blocks due to wrong extents moved_len

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 19% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 81.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: ext4: fix double-free of blocks due to wrong extents moved_len In ext4_move_extents(), moved_len is only updated when all moves are successfully executed, and only discards orig_inode and donor_inode preallocations when moved_len is not zero. When the loop fails to exit after successfully moving some extents, moved_len is not updated and remains at 0, so it does not discard the preallocations. If the moved extents overlap with the preallocated extents, the overlapped extents are freed twice in ext4_mb_release_inode_pa() and ext4_process_freed_data() (as described in commit 94d7c16cbbbd ("ext4: Fix double-free of blocks with EXT4_IOC_MOVE_EXT")), and bb_free is incremented twice. Hence when trim is executed, a zero-division bug is triggered in mb_update_avg_fragment_size() because bb_free is not zero and bb_fragments is zero. Therefore, update move_len after each extent move to avoid the issue.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.82-1DEBIAN-CVE-2024-26704
Debian:13linux6.7.7-1DEBIAN-CVE-2024-26704
Debian:14linux6.7.7-1DEBIAN-CVE-2024-26704
Ubuntu:22.04:LTSlinux5.15.0-106.116UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-aws5.15.0-1061.67UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-aws-6.56.5.0-1020.20~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-aws-6.56.5.0-1020.20~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure5.15.0-1063.72UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-6.56.5.0-1021.22~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-azure-6.56.5.0-1021.22~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1063.72.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gcp5.15.0-1059.67UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gcp-6.56.5.0-1020.20~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gcp-6.56.5.0-1020.20~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-gke5.15.0-1058.63UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1044.51UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-hwe-6.56.5.0-35.35~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-hwe-6.56.5.0-35.35~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-ibm5.15.0-1054.57UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1057.63UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-kvm5.15.0-1058.63UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-106.116UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.56.5.0-35.35.1~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.56.5.0-35.35.1~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1054.55UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-nvidia-6.56.5.0-1019.19USN-6774-1
Ubuntu:22.04:LTSlinux-nvidia-6.56.5.0-1019.19UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1026.26UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1015.15UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oem-6.56.5.0-1023.24USN-6774-1
Ubuntu:22.04:LTSlinux-oem-6.56.5.0-1023.24UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oracle5.15.0-1059.65UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oracle-6.56.5.0-1023.23~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-oracle-6.56.5.0-1023.23~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-raspi5.15.0-1054.57UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-riscv-6.56.5.0-35.35.1~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-starfive-6.56.5.0-1014.15~22.04.1USN-6774-1
Ubuntu:22.04:LTSlinux-starfive-6.56.5.0-1014.15~22.04.1UBUNTU-CVE-2024-26704
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1030.34UBUNTU-CVE-2024-26704

Affected products (as reported)

VendorProductVersions
Linux Linux fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before b4fbb89d722cbb16beaaea234b7230faaaf68c71fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before afbcad9ae7d6d11608399188f03a837451b6b3a1fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before d033a555d9a1cf53dbf3301af7199cc4a4c8f537fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before afba9d11320dad5ce222ac8964caf64b7b4bedb1fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before 185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before 2883940b19c38d5884c8626483811acf4d7e148ffcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before 559ddacb90da1d8786dd8ec4fd76bbfa404eaef6fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a – before 55583e899a5357308274601364741a83e78d6ac4
Linux Linux 3.18

References