CVE-2024-26704: ext4: fix double-free of blocks due to wrong extents moved_len
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.
Security readout for executives and security teams
Plain-English summary
A flaw in Linux ext4 extent-moving logic can free the same storage blocks twice, corrupt filesystem accounting, and trigger a kernel division-by-zero during trimming. Successful abuse requires local access and low privileges, but the stated potential impact includes confidentiality, integrity, and availability. Systems using affected Linux kernels with ext4 filesystems deserve prompt remediation.
Executive priority
Treat as a high-priority operating-system maintenance issue, especially on shared Linux hosts using ext4. It does not present documented remote or active exploitation, so emergency internet-edge response is unsupported. Patch through normal accelerated kernel maintenance, prioritizing systems with untrusted local users or sensitive data.
Technical view
ext4_move_extents() could leave moved_len at zero after partially successful extent moves. Consequently, inode preallocations were not discarded, allowing overlapping extents to be released twice. This corrupts bb_free accounting; a later trim can reach mb_update_avg_fragment_size() with bb_free nonzero and bb_fragments zero, causing division by zero. Stable kernel commits update moved_len after each move.
Likely exposure
Exposure is limited to Linux systems running an affected kernel and using ext4. The supplied CVSS vector requires local access and low privileges, with no user interaction. The bundle identifies affected releases or branches from 3.18 through 6.8, but its version formatting is insufficient to establish precise downstream distribution package boundaries.
Exploitation context
The supplied record is not in CISA KEV and provides no evidence of active exploitation. The flaw is locally reachable rather than remotely exploitable according to CVSS. Exploitation would depend on affected ext4 extent-moving behavior and overlapping preallocations; the documented failure may surface during filesystem trimming.
Researcher notes
The core condition is stale moved_len after partial success, missed preallocation cleanup, double release, corrupted free-space counters, and a later trim-triggered zero division. Multiple upstream stable commits are supplied, indicating backports across kernel lines. Exact introduction and fixed-version ranges cannot be reconstructed confidently from the bundle’s flattened version list.
Mitigation direction
Install a distribution-supported kernel containing the applicable upstream stable fix.
Consult the Linux distribution advisory to map packaged kernel versions accurately.
Prioritize multi-user systems where untrusted local accounts can access ext4 storage.
Reboot into the corrected kernel after installation, following vendor guidance.
Validation and detection
Inventory running kernel versions and identify mounted ext4 filesystems.
Compare installed kernel packages against distribution advisories and upstream stable fixes.
Confirm the running kernel changed after remediation and reboot.
Review kernel logs for ext4 errors, division faults, or unexpected trim-related crashes.
Verify routine filesystem and trim operations remain healthy after patching.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-26704 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.