CyberSecBulletin
CVE-2024-26704NVD status: Modified

Linux: Double Free

CVE-2024-26704 is a high-severity double free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions b4fbb89d722cbb16beaaea234b7230faaaf68c71, afbcad9ae7d6d11608399188f03a837451b6b3a1, d033a555d9a1cf53dbf3301af7199cc4a4c8f537 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.27% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to b4fbb89d722cbb16beaaea234b7230faaaf68c71 or afbcad9ae7d6d11608399188f03a837451b6b3a1 or d033a555d9a1cf53dbf3301af7199cc4a4c8f537 or afba9d11320dad5ce222ac8964caf64b7b4bedb1, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.307 or 5.4.269 or 5.10.210 or 5.15.149, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxfcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, b4fbb89d722cbb16beaaea234b7230faaaf68c71; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, afbcad9ae7d6d11608399188f03a837451b6b3a1; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, d033a555d9a1cf53dbf3301af7199cc4a4c8f537; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, afba9d11320dad5ce222ac8964caf64b7b4bedb1; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, 185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, 2883940b19c38d5884c8626483811acf4d7e148f; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, 559ddacb90da1d8786dd8ec4fd76bbfa404eaef6; fcf6b1b729bcd23f2b49a84fb33ffbb44712ee6a up to, but not including, 55583e899a5357308274601364741a83e78d6ac4; and 1 more rangesb4fbb89d722cbb16beaaea234b7230faaaf68c71, afbcad9ae7d6d11608399188f03a837451b6b3a1, d033a555d9a1cf53dbf3301af7199cc4a4c8f537, afba9d11320dad5ce222ac8964caf64b7b4bedb1, 185eab30486ba3e7bf8b9c2e049c79a06ffd2bc1, 2883940b19c38d5884c8626483811acf4d7e148f
LinuxLinux Kernel3.18 up to, but not including, 4.19.307; 4.20 up to, but not including, 5.4.269; 5.5 up to, but not including, 5.10.210; 5.11 up to, but not including, 5.15.149; 5.16 up to, but not including, 6.1.79; 6.2 up to, but not including, 6.6.18; 6.7 up to, but not including, 6.7.6; 6.84.19.307, 5.4.269, 5.10.210, 5.15.149, 6.1.79, 6.6.18
DebianDebian Linux10.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Double Free

The product calls free() twice on the same memory address.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • Ensure that each allocation is freed only once. After freeing a chunk, set the pointer to NULL to ensure the pointer cannot be freed again. In complicated error conditions, be sure that clean-up routines respect the state of allocation properly. If the language is object oriented, ensure that object destructors delete each chunk of memory only once.
  • Use a static analysis tool to find double free instances.

More Double Free vulnerabilities (CWE-415)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Double Free vulnerabilities

Spotted an error? Tell us.