CVE-2024-26704
ext4: fix double-free of blocks due to wrong extents moved_len
Check your servers for CVE-2024-26704
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-26704 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.27%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 20.2% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before b4fbb89d722cbb16beaaea234b7230faaaf68c71 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before afbcad9ae7d6d11608399188f03a837451b6b3a1 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before d033a555d9a1cf53dbf3301af7199cc4a4c8f537 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before afba9d11320dad5ce222ac8964caf64b7b4bedb1 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before 185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before 2883940b19c38d5884c8626483811acf4d7e148f affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before 559ddacb90da1d8786dd8ec4fd76bbfa404eaef6 affected from fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a, before 55583e899a5357308274601364741a83e78d6ac4
Other versions: unaffected
|
| Linux |
affected 3.18 unaffected before 3.18 unaffected from 4.19.307 up to and including 4.19.* unaffected from 5.4.269 up to and including 5.4.* unaffected from 5.10.210 up to and including 5.10.* unaffected from 5.15.149 up to and including 5.15.* unaffected from 6.1.79 up to and including 6.1.* unaffected from 6.6.18 up to and including 6.6.* unaffected from 6.7.6 up to and including 6.7.* unaffected 6.8 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-26704 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-26704
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-26704
trivy image --scanners vuln IMAGE | grep CVE-2024-26704
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/b4fbb89d722cbb16beaaea234b7230faaaf68c71 git.kernel.org
- https://git.kernel.org/stable/c/afbcad9ae7d6d11608399188f03a837451b6b3a1 git.kernel.org
- https://git.kernel.org/stable/c/d033a555d9a1cf53dbf3301af7199cc4a4c8f537 git.kernel.org
- https://git.kernel.org/stable/c/afba9d11320dad5ce222ac8964caf64b7b4bedb1 git.kernel.org
- https://git.kernel.org/stable/c/185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1 git.kernel.org
- https://git.kernel.org/stable/c/2883940b19c38d5884c8626483811acf4d7e148f git.kernel.org
- https://git.kernel.org/stable/c/559ddacb90da1d8786dd8ec4fd76bbfa404eaef6 git.kernel.org
- https://git.kernel.org/stable/c/55583e899a5357308274601364741a83e78d6ac4 git.kernel.org
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html lists.debian.org
- https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html lists.debian.org
Source: the record CVE-2024-26704 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse