# CVE-2024-46733: btrfs: fix qgroup reserve leaks in cow\_file\_range

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-09-18T06:32:27.453Z
- **Modified:** 2026-06-17T07:55:49.147Z

## Who should check

- Anyone running Linux \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 159f0f61b283ea71e827dd0c18c5dce197de1fa2; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 84464db2ec2a55b9313d5f264da196a37ec80994; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 30479f31d44d47ed00ae0c7453d9b253537005b2
- Anyone running Linux 5.9

## Description

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

btrfs: fix qgroup reserve leaks in cow\_file\_range

In the buffered write path, the dirty page owns the qgroup reserve until
it creates an ordered\_extent.

Therefore, any errors that occur before the ordered\_extent is created
must free that reservation, or else the space is leaked. The fstest
generic/475 exercises various IO error paths, and is able to trigger
errors in cow\_file\_range where we fail to get to allocating the ordered
extent. Note that because we \*do\* clear delalloc, we are likely to
remove the inode from the delalloc list, so the inodes/pages to not have
invalidate/launder called on them in the commit abort path.

This results in failures at the unmount stage of the test that look like:

  BTRFS: error (device dm-8 state EA) in cleanup\_transaction:2018: errno=-5 IO failure
  BTRFS: error (device dm-8 state EA) in btrfs\_replace\_file\_extents:2416: errno=-5 IO failure
  BTRFS warning (device dm-8 state EA): qgroup 0/5 has unreleased space, type 0 rsv 28672
  ------------\[ cut here \]------------
  WARNING: CPU: 3 PID: 22588 at fs/btrfs/disk-io.c:4333 close\_ctree+0x222/0x4d0 \[btrfs\]
  Modules linked in: btrfs blake2b\_generic libcrc32c xor zstd\_compress raid6\_pq
  CPU: 3 PID: 22588 Comm: umount Kdump: loaded Tainted: G W          6.10.0-rc7-gab56fde445b8 \#21
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Arch Linux 1.16.3-1-1 04/01/2014
  RIP: 0010:close\_ctree+0x222/0x4d0 \[btrfs\]
  RSP: 0018:ffffb4465283be00 EFLAGS: 00010202
  RAX: 0000000000000001 RBX: ffffa1a1818e1000 RCX: 0000000000000001
  RDX: 0000000000000000 RSI: ffffb4465283bbe0 RDI: ffffa1a19374fcb8
  RBP: ffffa1a1818e13c0 R08: 0000000100028b16 R09: 0000000000000000
  R10: 0000000000000003 R11: 0000000000000003 R12: ffffa1a18ad7972c
  R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
  FS:  00007f9168312b80(0000) GS:ffffa1a4afcc0000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f91683c9140 CR3: 000000010acaa000 CR4: 00000000000006f0
  Call Trace:
   \<TASK\>
   ? close\_ctree+0x222/0x4d0 \[btrfs\]
   ? \_\_warn.cold+0x8e/0xea
   ? close\_ctree+0x222/0x4d0 \[btrfs\]
   ? report\_bug+0xff/0x140
   ? handle\_bug+0x3b/0x70
   ? exc\_invalid\_op+0x17/0x70
   ? asm\_exc\_invalid\_op+0x1a/0x20
   ? close\_ctree+0x222/0x4d0 \[btrfs\]
   generic\_shutdown\_super+0x70/0x160
   kill\_anon\_super+0x11/0x40
   btrfs\_kill\_super+0x11/0x20 \[btrfs\]
   deactivate\_locked\_super+0x2e/0xa0
   cleanup\_mnt+0xb5/0x150
   task\_work\_run+0x57/0x80
   syscall\_exit\_to\_user\_mode+0x121/0x130
   do\_syscall\_64+0xab/0x1a0
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
  RIP: 0033:0x7f916847a887
  ---\[ end trace 0000000000000000 \]---
  BTRFS error (device dm-8 state EA): qgroup reserved space leaked

Cases 2 and 3 in the out\_reserve path both pertain to this type of leak
and must free the reserved qgroup data. Because it is already an error
path, I opted not to handle the possible errors in
btrfs\_free\_qgroup\_data.

## Affected and fixed versions

- Linux: \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 159f0f61b283ea71e827dd0c18c5dce197de1fa2; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 84464db2ec2a55b9313d5f264da196a37ec80994; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 30479f31d44d47ed00ae0c7453d9b253537005b2 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 30479f31d44d47ed00ae0c7453d9b253537005b2 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-46733.md
Affected: Linux >= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, < 159f0f61b283ea71e827dd0c18c5dce197de1fa2; >= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, < 84464db2ec2a55b9313d5f264da196a37ec80994; >= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, < e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f; >= 7dbeaad0af7d0a1a2a8e41d…
Fixed in: Linux 159f0f61b283ea71e827dd0c18c5dce197de1fa2, Linux 84464db2ec2a55b9313d5f264da196a37ec80994, Linux 30479f31d44d47ed00ae0c7453d9b253537005b2

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

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 159f0f61b283ea71e827dd0c18c5dce197de1fa2; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 84464db2ec2a55b9313d5f264da196a37ec80994; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f; \>= 7dbeaad0af7d0a1a2a8e41d04e90964368ddfcc5, \< 30479f31d44d47ed00ae0c7453d9b253537005b2; Linux 5.9.

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

Yes. Fixed in Linux 159f0f61b283ea71e827dd0c18c5dce197de1fa2, Linux 84464db2ec2a55b9313d5f264da196a37ec80994, Linux 30479f31d44d47ed00ae0c7453d9b253537005b2. Upgrade Linux to 30479f31d44d47ed00ae0c7453d9b253537005b2 or later.

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

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/159f0f61b283ea71e827dd0c18c5dce197de1fa2>
- patch: <https://git.kernel.org/stable/c/84464db2ec2a55b9313d5f264da196a37ec80994>
- patch: <https://git.kernel.org/stable/c/e42ef22bc10f0309c0c65d8d6ca8b4127a674b7f>
- patch: <https://git.kernel.org/stable/c/30479f31d44d47ed00ae0c7453d9b253537005b2>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.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-46733>

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