# CVE-2024-57896: btrfs: flush delalloc workers queue before stopping cleaner kthread during unmount

> 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 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-01-15T13:05:48.310Z
- **Modified:** 2026-08-05T11:46:49.998Z

## Who should check

- Anyone running Linux \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< a2718ed1eb8c3611b63f8933c7e68c8821fe2808; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 63f4b594a688bf922e8691f0784679aa7af7988c; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 1ea629e7bb2fb40555e5e01a1b5095df31287017; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 35916b2f96505a18dc7242a115611b718d9de725; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< d77a3a99b53d12c061c007cdc96df38825dee476; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< f10bef73fb355e3fc85e63a50386798be68ff486
- Anyone running Linux 5.0

## Description

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

btrfs: flush delalloc workers queue before stopping cleaner kthread during unmount

During the unmount path, at close\_ctree(), we first stop the cleaner
kthread, using kthread\_stop() which frees the associated task\_struct, and
then stop and destroy all the work queues. However after we stopped the
cleaner we may still have a worker from the delalloc\_workers queue running
inode.c:submit\_compressed\_extents(), which calls btrfs\_add\_delayed\_iput(),
which in turn tries to wake up the cleaner kthread - which was already
destroyed before, resulting in a use-after-free on the task\_struct.

Syzbot reported this with the following stack traces:

  BUG: KASAN: slab-use-after-free in \_\_lock\_acquire+0x78/0x2100 kernel/locking/lockdep.c:5089
  Read of size 8 at addr ffff8880259d2818 by task kworker/u8:3/52

  CPU: 1 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted 6.13.0-rc1-syzkaller-00002-gcdd30ebb1b9f \#0
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
  Workqueue: btrfs-delalloc btrfs\_work\_helper
  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
   \_\_lock\_acquire+0x78/0x2100 kernel/locking/lockdep.c:5089
   lock\_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
   \_\_raw\_spin\_lock\_irqsave include/linux/spinlock\_api\_smp.h:110 \[inline\]
   \_raw\_spin\_lock\_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
   class\_raw\_spinlock\_irqsave\_constructor include/linux/spinlock.h:551 \[inline\]
   try\_to\_wake\_up+0xc2/0x1470 kernel/sched/core.c:4205
   submit\_compressed\_extents+0xdf/0x16e0 fs/btrfs/inode.c:1615
   run\_ordered\_work fs/btrfs/async-thread.c:288 \[inline\]
   btrfs\_work\_helper+0x96f/0xc40 fs/btrfs/async-thread.c:324
   process\_one\_work kernel/workqueue.c:3229 \[inline\]
   process\_scheduled\_works+0xa66/0x1840 kernel/workqueue.c:3310
   worker\_thread+0x870/0xd30 kernel/workqueue.c:3391
   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 2:
   kasan\_save\_stack mm/kasan/common.c:47 \[inline\]
   kasan\_save\_track+0x3f/0x80 mm/kasan/common.c:68
   unpoison\_slab\_object mm/kasan/common.c:319 \[inline\]
   \_\_kasan\_slab\_alloc+0x66/0x80 mm/kasan/common.c:345
   kasan\_slab\_alloc include/linux/kasan.h:250 \[inline\]
   slab\_post\_alloc\_hook mm/slub.c:4104 \[inline\]
   slab\_alloc\_node mm/slub.c:4153 \[inline\]
   kmem\_cache\_alloc\_node\_noprof+0x1d9/0x380 mm/slub.c:4205
   alloc\_task\_struct\_node kernel/fork.c:180 \[inline\]
   dup\_task\_struct+0x57/0x8c0 kernel/fork.c:1113
   copy\_process+0x5d1/0x3d50 kernel/fork.c:2225
   kernel\_clone+0x223/0x870 kernel/fork.c:2807
   kernel\_thread+0x1bc/0x240 kernel/fork.c:2869
   create\_kthread kernel/kthread.c:412 \[inline\]
   kthreadd+0x60d/0x810 kernel/kthread.c:767
   ret\_from\_fork+0x4b/0x80 arch/x86/kernel/process.c:147
   ret\_from\_fork\_asm+0x1a/0x30 arch/x86/entry/entry\_64.S:244

  Freed by task 24:
   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:2338 \[inline\]
   slab\_free mm/slub.c:4598 \[inline\]
   kmem\_cache\_free+0x195/0x410 mm/slub.c:4700
   put\_task\_struct include/linux/sched/task.h:144 \[inline\]
   delayed\_put\_task\_struct+0x125/0x300 kernel/exit.c:227
   rcu\_do\_batch kernel/rcu/tree.c:2567 \[inline\]
   rcu\_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823
   handle\_softirqs+0x2d4/0x9b0 kernel/softirq.c:554
   run\_ksoftirqd+0xca/0x130 kernel/softirq.c:943
  
---truncated---

## Affected and fixed versions

- Linux: \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< a2718ed1eb8c3611b63f8933c7e68c8821fe2808; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 63f4b594a688bf922e8691f0784679aa7af7988c; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 1ea629e7bb2fb40555e5e01a1b5095df31287017; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 35916b2f96505a18dc7242a115611b718d9de725; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< d77a3a99b53d12c061c007cdc96df38825dee476; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< f10bef73fb355e3fc85e63a50386798be68ff486 (cvelist)
- Linux: 5.0 (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-2024-57896. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-57896.md
Affected: Linux >= fd340d0f68cc87badfc9efcb226f23a5428826a0, < a2718ed1eb8c3611b63f8933c7e68c8821fe2808; >= fd340d0f68cc87badfc9efcb226f23a5428826a0, < 63f4b594a688bf922e8691f0784679aa7af7988c; >= fd340d0f68cc87badfc9efcb226f23a5428826a0, < 1ea629e7bb2fb40555e5e01a1b5095df31287017; >= fd340d0f68cc87badfc9efc…
Fixed in: Linux 63f4b594a688bf922e8691f0784679aa7af7988c, Linux 1ea629e7bb2fb40555e5e01a1b5095df31287017, Linux 35916b2f96505a18dc7242a115611b718d9de725

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-2024-57896 being exploited?

There is no confirmed exploitation: CVE-2024-57896 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-2024-57896?

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

### Which versions are affected by CVE-2024-57896?

Linux \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< a2718ed1eb8c3611b63f8933c7e68c8821fe2808; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 63f4b594a688bf922e8691f0784679aa7af7988c; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 1ea629e7bb2fb40555e5e01a1b5095df31287017; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< 35916b2f96505a18dc7242a115611b718d9de725; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< d77a3a99b53d12c061c007cdc96df38825dee476; \>= fd340d0f68cc87badfc9efcb226f23a5428826a0, \< f10bef73fb355e3fc85e63a50386798be68ff486; Linux 5.0.

### Is there a fix for CVE-2024-57896?

Yes. Fixed in Linux 63f4b594a688bf922e8691f0784679aa7af7988c, Linux 1ea629e7bb2fb40555e5e01a1b5095df31287017, Linux 35916b2f96505a18dc7242a115611b718d9de725. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-57896?

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/a2718ed1eb8c3611b63f8933c7e68c8821fe2808>
- patch: <https://git.kernel.org/stable/c/63f4b594a688bf922e8691f0784679aa7af7988c>
- patch: <https://git.kernel.org/stable/c/1ea629e7bb2fb40555e5e01a1b5095df31287017>
- patch: <https://git.kernel.org/stable/c/35916b2f96505a18dc7242a115611b718d9de725>
- patch: <https://git.kernel.org/stable/c/d77a3a99b53d12c061c007cdc96df38825dee476>
- patch: <https://git.kernel.org/stable/c/f10bef73fb355e3fc85e63a50386798be68ff486>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.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-2024-57896>

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