# CVE-2025-21753: btrfs: fix use-after-free when attempting to join an aborted transaction

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 18, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-02-27T02:12:23.235Z
- **Modified:** 2026-10-15T02:17:32.183Z

## Who should check

- Anyone running Linux \>= 871383be592ba7e819d27556591e315a0df38cee, \< cee55b1219568c80bf0d5dc55066e4a859baf753; \>= 871383be592ba7e819d27556591e315a0df38cee, \< c7a53757717e68af94a56929d57f1e6daff220ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 6ba4663ada6c6315af23a6669d386146634808ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 8f5cff471039caa2b088060c074c2bf2081bcb01; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 86d71a026a7f63da905db9add845c8ee88801eca; \>= 871383be592ba7e819d27556591e315a0df38cee, \< ce628048390dad80320d5a1f74de6ca1e1be91e7; \>= 871383be592ba7e819d27556591e315a0df38cee, \< e2f0943cf37305dbdeaf9846e3c941451bcdef63
- Anyone running Linux 3.4

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix use-after-free when attempting to join an aborted transaction

When we are trying to join the current transaction and if it's aborted,
we read its 'aborted' field after unlocking fs\_info-\>trans\_lock and
without holding any extra reference count on it. This means that a
concurrent task that is aborting the transaction may free the transaction
before we read its 'aborted' field, leading to a use-after-free.

Fix this by reading the 'aborted' field while holding fs\_info-\>trans\_lock
since any freeing task must first acquire that lock and set
fs\_info-\>running\_transaction to NULL before freeing the transaction.

This was reported by syzbot and Dmitry with the following stack traces
from KASAN:

   ==================================================================
   BUG: KASAN: slab-use-after-free in join\_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
   Read of size 4 at addr ffff888011839024 by task kworker/u4:9/1128

   CPU: 0 UID: 0 PID: 1128 Comm: kworker/u4:9 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e \#0
   Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
   Workqueue: events\_unbound btrfs\_async\_reclaim\_data\_space
   Call Trace:
    \<TASK\>
    \_\_dump\_stack lib/dump\_stack.c:94 \[inline\]
    dump\_stack\_lvl+0x241/0x360 lib/dump\_stack.c:120
    print\_address\_description mm/kasan/report.c:378 \[inline\]
    print\_report+0x169/0x550 mm/kasan/report.c:489
    kasan\_report+0x143/0x180 mm/kasan/report.c:602
    join\_transaction+0xd9b/0xda0 fs/btrfs/transaction.c:278
    start\_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
    flush\_space+0x448/0xcf0 fs/btrfs/space-info.c:803
    btrfs\_async\_reclaim\_data\_space+0x159/0x510 fs/btrfs/space-info.c:1321
    process\_one\_work kernel/workqueue.c:3236 \[inline\]
    process\_scheduled\_works+0xa66/0x1840 kernel/workqueue.c:3317
    worker\_thread+0x870/0xd30 kernel/workqueue.c:3398
    kthread+0x2f0/0x390 kernel/kthread.c:389
    ret\_from\_fork+0x4b/0x80 arch/x86/kernel/process.c:147
    ret\_from\_fork\_asm+0x1a/0x30 arch/x86/entry/entry\_64.S:244
    \</TASK\>

   Allocated by task 5315:
    kasan\_save\_stack mm/kasan/common.c:47 \[inline\]
    kasan\_save\_track+0x3f/0x80 mm/kasan/common.c:68
    poison\_kmalloc\_redzone mm/kasan/common.c:377 \[inline\]
    \_\_kasan\_kmalloc+0x98/0xb0 mm/kasan/common.c:394
    kasan\_kmalloc include/linux/kasan.h:260 \[inline\]
    \_\_kmalloc\_cache\_noprof+0x243/0x390 mm/slub.c:4329
    kmalloc\_noprof include/linux/slab.h:901 \[inline\]
    join\_transaction+0x144/0xda0 fs/btrfs/transaction.c:308
    start\_transaction+0xaf8/0x1670 fs/btrfs/transaction.c:697
    btrfs\_create\_common+0x1b2/0x2e0 fs/btrfs/inode.c:6572
    lookup\_open fs/namei.c:3649 \[inline\]
    open\_last\_lookups fs/namei.c:3748 \[inline\]
    path\_openat+0x1c03/0x3590 fs/namei.c:3984
    do\_filp\_open+0x27f/0x4e0 fs/namei.c:4014
    do\_sys\_openat2+0x13e/0x1d0 fs/open.c:1402
    do\_sys\_open fs/open.c:1417 \[inline\]
    \_\_do\_sys\_creat fs/open.c:1495 \[inline\]
    \_\_se\_sys\_creat fs/open.c:1489 \[inline\]
    \_\_x64\_sys\_creat+0x123/0x170 fs/open.c:1489
    do\_syscall\_x64 arch/x86/entry/common.c:52 \[inline\]
    do\_syscall\_64+0xf3/0x230 arch/x86/entry/common.c:83
    entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

   Freed by task 5336:
    kasan\_save\_stack mm/kasan/common.c:47 \[inline\]
    kasan\_save\_track+0x3f/0x80 mm/kasan/common.c:68
    kasan\_save\_free\_info+0x40/0x50 mm/kasan/generic.c:582
    poison\_slab\_object mm/kasan/common.c:247 \[inline\]
    \_\_kasan\_slab\_free+0x59/0x70 mm/kasan/common.c:264
    kasan\_slab\_free include/linux/kasan.h:233 \[inline\]
    slab\_free\_hook mm/slub.c:2353 \[inline\]
    slab\_free mm/slub.c:4613 \[inline\]
    kfree+0x196/0x430 mm/slub.c:4761
    cleanup\_transaction fs/btrfs/transaction.c:2063 \[inline\]
    btrfs\_commit\_transaction+0x2c97/0x3720 fs/btrfs/transaction.c:2598
    insert\_balance\_item+0x1284/0x20b0 fs/btrfs/volumes.c:3757
    btrfs\_balance+0x992/
---truncated---

## Affected and fixed versions

- Linux: \>= 871383be592ba7e819d27556591e315a0df38cee, \< cee55b1219568c80bf0d5dc55066e4a859baf753; \>= 871383be592ba7e819d27556591e315a0df38cee, \< c7a53757717e68af94a56929d57f1e6daff220ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 6ba4663ada6c6315af23a6669d386146634808ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 8f5cff471039caa2b088060c074c2bf2081bcb01; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 86d71a026a7f63da905db9add845c8ee88801eca; \>= 871383be592ba7e819d27556591e315a0df38cee, \< ce628048390dad80320d5a1f74de6ca1e1be91e7; \>= 871383be592ba7e819d27556591e315a0df38cee, \< e2f0943cf37305dbdeaf9846e3c941451bcdef63 (cvelist)
- Linux: 3.4 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21753. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21753.md
Affected: Linux >= 871383be592ba7e819d27556591e315a0df38cee, < cee55b1219568c80bf0d5dc55066e4a859baf753; >= 871383be592ba7e819d27556591e315a0df38cee, < c7a53757717e68af94a56929d57f1e6daff220ec; >= 871383be592ba7e819d27556591e315a0df38cee, < 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc; >= 871383be592ba7e819d2755…
Fixed in: Linux 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc, Linux 6ba4663ada6c6315af23a6669d386146634808ec, Linux 8f5cff471039caa2b088060c074c2bf2081bcb01, Linux 86d71a026a7f63da905db9add845c8ee88801eca

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21753 being exploited?

There is no confirmed exploitation: CVE-2025-21753 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21753?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21753?

Linux \>= 871383be592ba7e819d27556591e315a0df38cee, \< cee55b1219568c80bf0d5dc55066e4a859baf753; \>= 871383be592ba7e819d27556591e315a0df38cee, \< c7a53757717e68af94a56929d57f1e6daff220ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 6ba4663ada6c6315af23a6669d386146634808ec; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 8f5cff471039caa2b088060c074c2bf2081bcb01; \>= 871383be592ba7e819d27556591e315a0df38cee, \< 86d71a026a7f63da905db9add845c8ee88801eca; \>= 871383be592ba7e819d27556591e315a0df38cee, \< ce628048390dad80320d5a1f74de6ca1e1be91e7; \>= 871383be592ba7e819d27556591e315a0df38cee, \< e2f0943cf37305dbdeaf9846e3c941451bcdef63; Linux 3.4.

### Is there a fix for CVE-2025-21753?

Yes. Fixed in Linux 7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc, Linux 6ba4663ada6c6315af23a6669d386146634808ec, Linux 8f5cff471039caa2b088060c074c2bf2081bcb01, Linux 86d71a026a7f63da905db9add845c8ee88801eca. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-21753?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/cee55b1219568c80bf0d5dc55066e4a859baf753>
- patch: <https://git.kernel.org/stable/c/c7a53757717e68af94a56929d57f1e6daff220ec>
- patch: <https://git.kernel.org/stable/c/7e954b6bb95d67ae4d1a20e9cfd83c182cf929bc>
- patch: <https://git.kernel.org/stable/c/6ba4663ada6c6315af23a6669d386146634808ec>
- patch: <https://git.kernel.org/stable/c/8f5cff471039caa2b088060c074c2bf2081bcb01>
- patch: <https://git.kernel.org/stable/c/86d71a026a7f63da905db9add845c8ee88801eca>
- patch: <https://git.kernel.org/stable/c/ce628048390dad80320d5a1f74de6ca1e1be91e7>
- patch: <https://git.kernel.org/stable/c/e2f0943cf37305dbdeaf9846e3c941451bcdef63>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21753>

HTML: <https://flawdb.com/CVE-2025-21753> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21753>
