CyberSecBulletin
CVE-2024-56759NVD status: Modified

Linux: Use After Free

CVE-2024-56759 is a high-severity use after 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 ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1, 526ff5b27f090fb15040471f892cd2c9899ce314, 66376f1a73cba57fd0af2631d7888605b738e499 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.22% 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 ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1 or 526ff5b27f090fb15040471f892cd2c9899ce314 or 66376f1a73cba57fd0af2631d7888605b738e499 or 9a466b8693b9add05de99af00c7bdff8259ecf19, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 6.12.8 or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1; 3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, 526ff5b27f090fb15040471f892cd2c9899ce314; 3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, 66376f1a73cba57fd0af2631d7888605b738e499; 3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, 9a466b8693b9add05de99af00c7bdff8259ecf19; 3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, c3a403d8ce36f5a809a492581de5ad17843e4701; 3083ee2e18b701122a3b841db83448543a87a583 up to, but not including, 44f52bbe96dfdbe4aca3818a2534520082a07040; 3.4ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1, 526ff5b27f090fb15040471f892cd2c9899ce314, 66376f1a73cba57fd0af2631d7888605b738e499, 9a466b8693b9add05de99af00c7bdff8259ecf19, c3a403d8ce36f5a809a492581de5ad17843e4701, 44f52bbe96dfdbe4aca3818a2534520082a07040
LinuxLinux Kernelbefore 6.12.8; 6.136.12.8

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.8HighNVD
CVSS 3.17.8HighCISA (ADP)

Official description

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free when COWing tree bock and tracing is enabled When a COWing a tree block, at btrfs_cow_block(), and we have the tracepoint trace_btrfs_cow_block() enabled and preemption is also enabled (CONFIG_PREEMPT=y), we can trigger a use-after-free in the COWed extent buffer while inside the tracepoint code. This is because in some paths that call btrfs_cow_block(), such as btrfs_search_slot(), we are holding the last reference on the extent buffer @buf so btrfs_force_cow_block() drops the last reference on the @buf extent buffer when it calls free_extent_buffer_stale(buf), which schedules the release of the extent buffer with RCU. This means that if we are on a kernel with preemption, the current task may be preempted before calling trace_btrfs_cow_block() and the extent buffer already released by the time trace_btrfs_cow_block() is called, resulting in a use-after-free. Fix this by moving the trace_btrfs_cow_block() from btrfs_cow_block() to btrfs_force_cow_block() before the COWed extent buffer is freed. This also has a side effect of invoking the tracepoint in the tree defrag code, at defrag.c:btrfs_realloc_node(), since btrfs_force_cow_block() is called there, but this is fine and it was actually missing there.

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

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

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

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.