CVE-2024-56759 json
btrfs: fix use-after-free when COWing tree bock and tracing is enabled
published 2025-01-06 22 mo ago modified 2026-08-05 3 mo ago also EUVD-2024-53402
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 12%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 5.10.233, 5.15.176, 6.1.124, 6.6.70, 6.12.8, 6.13
- linux Debian 12 6.1.124-1
- linux Debian 14, Debian 13 6.12.8-1
debian advisories DEBIAN-CVE-2024-56759
- linux Ubuntu 22.04 LTS 5.15.0-135.146
- linux Ubuntu 24.04 LTS 6.8.0-60.63
- linux-aws Ubuntu 22.04 LTS 5.15.0-1080.87
- linux-aws Ubuntu 24.04 LTS 6.8.0-1029.31
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1079.88
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1030.32
- linux-gke Ubuntu 22.04 LTS 5.15.0-1077.83
- linux-gke Ubuntu 24.04 LTS 6.8.0-1025.29
ubuntu advisories UBUNTU-CVE-2024-56759
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-source-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-livepatch-MICRO-6-0-RT_Update_5 Linux Micro 6.1, Linux Micro 6.0 1-1.1
- kernel-source Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-default Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-kvmsmall Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-default-base Linux Micro 6.1, Linux Micro 6.0 6.4.0-24.1.21.4
- kernel-livepatch-MICRO-6-0_Update_5 Linux Micro 6.1, Linux Micro 6.0 1-1.2
suse advisories SUSE-SU-2025:20166-1SUSE-SU-2025:20249-1SUSE-SU-2025:20165-1SUSE-SU-2025:20248-1SUSE-SU-2025:0867-1SUSE-SU-2025:0577-1
- git.kernel.org/stable/c/ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1 commit
- git.kernel.org/stable/c/526ff5b27f090fb15040471f892cd2c9899ce314 commit
- git.kernel.org/stable/c/66376f1a73cba57fd0af2631d7888605b738e499 commit
- git.kernel.org/stable/c/9a466b8693b9add05de99af00c7bdff8259ecf19 commit
- git.kernel.org/stable/c/c3a403d8ce36f5a809a492581de5ad17843e4701 commit
- git.kernel.org/stable/c/44f52bbe96dfdbe4aca3818a2534520082a07040 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-56759 updated cvss 6.7
kernel: btrfs: fix use-after-free when COWing tree bock and tracing is enabled
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 20 mo ago
Exploit prediction
0.22% chance of exploitation in the next 30 days, higher than 12% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA ADP | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
- git.kernel.org /stable/c/ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1
- git.kernel.org /stable/c/526ff5b27f090fb15040471f892cd2c9899ce314
- git.kernel.org /stable/c/66376f1a73cba57fd0af2631d7888605b738e499
- git.kernel.org /stable/c/9a466b8693b9add05de99af00c7bdff8259ecf19
-
git.kernel.org
/stable/c/c3a403d8ce36f5a809a492581de5ad17843e4701
patch
-
git.kernel.org
/stable/c/44f52bbe96dfdbe4aca3818a2534520082a07040
patch
- lists.debian.org /debian-lts-announce/2025/03/msg00001.html
- lists.debian.org /debian-lts-announce/2025/03/msg00002.html
Sources
- CVE List CVE-2024-56759
- NVD CVE-2024-56759
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.