# CVE-2024-49867: btrfs: wait for fixup workers before stopping cleaner kthread during umount

> 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.37% (percentile 23, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-10-21T18:01:09.962Z
- **Modified:** 2026-08-05T11:40:15.453Z

## Who should check

- Anyone running Linux \>= 7a97311de48d56af6db4c5819f95faf9b0b23b1a, \< a71349b692ab34ea197949e13e3cc42570fe73d9; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 70b60c8d9b42763d6629e44f448aa5d8ae477d61; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 4c98fe0dfa2ae83c4631699695506d8941db4bfe; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 9da40aea63f8769f28afb91aea0fac4cf6fbbb65; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< ed87190e9d9c80aad220fb6b0b03a84d22e2c95b; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< bf0de0f9a0544c11f96f93206da04ab87dcea1f4; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 65d11eb276836d49003a8060cf31fa2284ad1047; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 41fd1e94066a815a7ab0a7025359e9b40e4b3576; 6026fd9da213daab95469356fe7fdcf29ae1a296; \>= 5.4.22, \< 5.4.285; …
- Anyone running Linux 5.6

## Description

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

btrfs: wait for fixup workers before stopping cleaner kthread during umount

During unmount, at close\_ctree(), we have the following steps in this order:

1) Park the cleaner kthread - this doesn't destroy the kthread, it basically
   halts its execution (wake ups against it work but do nothing);

2) We stop the cleaner kthread - this results in freeing the respective
   struct task\_struct;

3) We call btrfs\_stop\_all\_workers() which waits for any jobs running in all
   the work queues and then free the work queues.

Syzbot reported a case where a fixup worker resulted in a crash when doing
a delayed iput on its inode while attempting to wake up the cleaner at
btrfs\_add\_delayed\_iput(), because the task\_struct of the cleaner kthread
was already freed. This can happen during unmount because we don't wait
for any fixup workers still running before we call kthread\_stop() against
the cleaner kthread, which stops and free all its resources.

Fix this by waiting for any fixup workers at close\_ctree() before we call
kthread\_stop() against the cleaner and run pending delayed iputs.

The stack traces reported by syzbot were the following:

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

  CPU: 1 UID: 0 PID: 52 Comm: kworker/u8:3 Not tainted 6.12.0-rc1-syzkaller \#0
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
  Workqueue: btrfs-fixup 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:377 \[inline\]
   print\_report+0x169/0x550 mm/kasan/report.c:488
   kasan\_report+0x143/0x180 mm/kasan/report.c:601
   \_\_lock\_acquire+0x77/0x2050 kernel/locking/lockdep.c:5065
   lock\_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
   \_\_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+0xb0/0x1480 kernel/sched/core.c:4154
   btrfs\_writepage\_fixup\_worker+0xc16/0xdf0 fs/btrfs/inode.c:2842
   btrfs\_work\_helper+0x390/0xc50 fs/btrfs/async-thread.c:314
   process\_one\_work kernel/workqueue.c:3229 \[inline\]
   process\_scheduled\_works+0xa63/0x1850 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:247 \[inline\]
   slab\_post\_alloc\_hook mm/slub.c:4086 \[inline\]
   slab\_alloc\_node mm/slub.c:4135 \[inline\]
   kmem\_cache\_alloc\_node\_noprof+0x16b/0x320 mm/slub.c:4187
   alloc\_task\_struct\_node kernel/fork.c:180 \[inline\]
   dup\_task\_struct+0x57/0x8c0 kernel/fork.c:1107
   copy\_process+0x5d1/0x3d50 kernel/fork.c:2206
   kernel\_clone+0x223/0x880 kernel/fork.c:2787
   kernel\_thread+0x1bc/0x240 kernel/fork.c:2849
   create\_kthread kernel/kthread.c:412 \[inline\]
   kthreadd+0x60d/0x810 kernel/kthread.c:765
   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 61:
   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:579
   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:230 \[inline\]
   slab\_free\_h
---truncated---

## Affected and fixed versions

- Linux: \>= 7a97311de48d56af6db4c5819f95faf9b0b23b1a, \< a71349b692ab34ea197949e13e3cc42570fe73d9; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 70b60c8d9b42763d6629e44f448aa5d8ae477d61; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 4c98fe0dfa2ae83c4631699695506d8941db4bfe; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 9da40aea63f8769f28afb91aea0fac4cf6fbbb65; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< ed87190e9d9c80aad220fb6b0b03a84d22e2c95b; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< bf0de0f9a0544c11f96f93206da04ab87dcea1f4; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 65d11eb276836d49003a8060cf31fa2284ad1047; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 41fd1e94066a815a7ab0a7025359e9b40e4b3576; 6026fd9da213daab95469356fe7fdcf29ae1a296; \>= 5.4.22, \< 5.4.285; … (cvelist)
- Linux: 5.6 (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-49867. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49867.md
Affected: Linux >= 7a97311de48d56af6db4c5819f95faf9b0b23b1a, < a71349b692ab34ea197949e13e3cc42570fe73d9; >= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, < 70b60c8d9b42763d6629e44f448aa5d8ae477d61; >= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, < 4c98fe0dfa2ae83c4631699695506d8941db4bfe; >= f4b1363cae43fef7c86c993…
Fixed in: Linux 70b60c8d9b42763d6629e44f448aa5d8ae477d61, Linux 4c98fe0dfa2ae83c4631699695506d8941db4bfe, Linux 9da40aea63f8769f28afb91aea0fac4cf6fbbb65, Linux 65d11eb276836d49003a8060cf31fa2284ad1047, Linux 41fd1e94066a815a7ab0a7025359e9b40e4b3576, Linux 5.4.285

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-49867 being exploited?

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

### How serious is CVE-2024-49867?

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

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

Linux \>= 7a97311de48d56af6db4c5819f95faf9b0b23b1a, \< a71349b692ab34ea197949e13e3cc42570fe73d9; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 70b60c8d9b42763d6629e44f448aa5d8ae477d61; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 4c98fe0dfa2ae83c4631699695506d8941db4bfe; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 9da40aea63f8769f28afb91aea0fac4cf6fbbb65; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< ed87190e9d9c80aad220fb6b0b03a84d22e2c95b; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< bf0de0f9a0544c11f96f93206da04ab87dcea1f4; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 65d11eb276836d49003a8060cf31fa2284ad1047; \>= f4b1363cae43fef7c86c993b7ca7fe7d546b3c68, \< 41fd1e94066a815a7ab0a7025359e9b40e4b3576; 6026fd9da213daab95469356fe7fdcf29ae1a296; \>= 5.4.22, \< 5.4.285; …; Linux 5.6.

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

Yes. Fixed in Linux 70b60c8d9b42763d6629e44f448aa5d8ae477d61, Linux 4c98fe0dfa2ae83c4631699695506d8941db4bfe, Linux 9da40aea63f8769f28afb91aea0fac4cf6fbbb65, Linux 65d11eb276836d49003a8060cf31fa2284ad1047, Linux 41fd1e94066a815a7ab0a7025359e9b40e4b3576, Linux 5.4.285. No fix listed yet: follow the vendor advisory.

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

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/70b60c8d9b42763d6629e44f448aa5d8ae477d61>
- patch: <https://git.kernel.org/stable/c/4c98fe0dfa2ae83c4631699695506d8941db4bfe>
- patch: <https://git.kernel.org/stable/c/9da40aea63f8769f28afb91aea0fac4cf6fbbb65>
- patch: <https://git.kernel.org/stable/c/ed87190e9d9c80aad220fb6b0b03a84d22e2c95b>
- patch: <https://git.kernel.org/stable/c/bf0de0f9a0544c11f96f93206da04ab87dcea1f4>
- patch: <https://git.kernel.org/stable/c/65d11eb276836d49003a8060cf31fa2284ad1047>
- patch: <https://git.kernel.org/stable/c/41fd1e94066a815a7ab0a7025359e9b40e4b3576>
- other: <https://git.kernel.org/stable/c/a71349b692ab34ea197949e13e3cc42570fe73d9>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.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-49867>

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