7.8
CWE
415
Advisory Published
CVE Published
Updated

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

First published: Wed Apr 03 2024(Updated: )

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.

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
redhat/kernel<4.19.307
4.19.307
redhat/kernel<5.4.269
5.4.269
redhat/kernel<5.10.210
5.10.210
redhat/kernel<5.15.149
5.15.149
redhat/kernel<6.1.79
6.1.79
redhat/kernel<6.6.18
6.6.18
redhat/kernel<6.7.6
6.7.6
redhat/kernel<6.8
6.8
Linux kernel>=3.18<4.19.307
Linux kernel>=4.20<5.4.269
Linux kernel>=5.5<5.10.210
Linux kernel>=5.11<5.15.149
Linux kernel>=5.16<6.1.79
Linux kernel>=6.2<6.6.18
Linux kernel>=6.7<6.7.6
Linux kernel=6.8-rc1
Linux kernel=6.8-rc2
Debian=10.0
debian/linux
5.10.223-1
5.10.234-1
6.1.123-1
6.1.128-1
6.12.12-1
6.12.16-1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Reference Links

Frequently Asked Questions

  • What is the severity of CVE-2024-26704?

    CVE-2024-26704 is considered a moderate severity vulnerability due to its potential impact on system stability.

  • How do I fix CVE-2024-26704?

    To mitigate CVE-2024-26704, update your Linux kernel to one of the patched versions listed, such as 4.19.307 or 5.4.269.

  • Which Linux kernel versions are affected by CVE-2024-26704?

    CVE-2024-26704 affects multiple Linux kernel versions, specifically those prior to 4.19.307, 5.4.269, 5.10.210, 5.15.149, 6.1.79, and others.

  • What is the specific issue described in CVE-2024-26704?

    CVE-2024-26704 involves a double-free of blocks in the ext4 file system due to incorrect management of moved_len in ext4_move_extents function.

  • Is my system vulnerable to CVE-2024-26704 if it's running an affected Linux kernel?

    Yes, if your system is running an affected version of the Linux kernel that has not been updated, it is vulnerable to CVE-2024-26704.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203