# CVE-2024-57806: btrfs: fix transaction atomicity bug when enabling simple quotas

> 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.26% (percentile 11, 2026-11-28)
- **CWE:** CWE-617
- **Published:** 2025-01-11T12:39:52.628Z
- **Modified:** 2026-06-17T08:14:04.507Z

## Who should check

- Anyone running Linux \>= 182940f4f4dbd932776414744c8de64333957725, \< b87c9b9ba05ba6e8e2ee9ecd29a8c930b35648ed; \>= 182940f4f4dbd932776414744c8de64333957725, \< f2363e6fcc7938c5f0f6ac066fad0dd247598b51
- Anyone running Linux 6.7

## Description

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

btrfs: fix transaction atomicity bug when enabling simple quotas

Set squota incompat bit before committing the transaction that enables
the feature.

With the config CONFIG\_BTRFS\_ASSERT enabled, an assertion
failure occurs regarding the simple quota feature.

  \[5.596534\] assertion failed: btrfs\_fs\_incompat(fs\_info, SIMPLE\_QUOTA), in fs/btrfs/qgroup.c:365
  \[5.597098\] ------------\[ cut here \]------------
  \[5.597371\] kernel BUG at fs/btrfs/qgroup.c:365!
  \[5.597946\] CPU: 1 UID: 0 PID: 268 Comm: mount Not tainted 6.13.0-rc2-00031-gf92f4749861b \#146
  \[5.598450\] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
  \[5.599008\] RIP: 0010:btrfs\_read\_qgroup\_config+0x74d/0x7a0
  \[5.604303\]  \<TASK\>
  \[5.605230\]  ? btrfs\_read\_qgroup\_config+0x74d/0x7a0
  \[5.605538\]  ? exc\_invalid\_op+0x56/0x70
  \[5.605775\]  ? btrfs\_read\_qgroup\_config+0x74d/0x7a0
  \[5.606066\]  ? asm\_exc\_invalid\_op+0x1f/0x30
  \[5.606441\]  ? btrfs\_read\_qgroup\_config+0x74d/0x7a0
  \[5.606741\]  ? btrfs\_read\_qgroup\_config+0x74d/0x7a0
  \[5.607038\]  ? try\_to\_wake\_up+0x317/0x760
  \[5.607286\]  open\_ctree+0xd9c/0x1710
  \[5.607509\]  btrfs\_get\_tree+0x58a/0x7e0
  \[5.608002\]  vfs\_get\_tree+0x2e/0x100
  \[5.608224\]  fc\_mount+0x16/0x60
  \[5.608420\]  btrfs\_get\_tree+0x2f8/0x7e0
  \[5.608897\]  vfs\_get\_tree+0x2e/0x100
  \[5.609121\]  path\_mount+0x4c8/0xbc0
  \[5.609538\]  \_\_x64\_sys\_mount+0x10d/0x150

The issue can be easily reproduced using the following reproducer:

  root@q:linux\# cat repro.sh
  set -e

  mkfs.btrfs -q -f /dev/sdb
  mount /dev/sdb /mnt/btrfs
  btrfs quota enable -s /mnt/btrfs
  umount /mnt/btrfs
  mount /dev/sdb /mnt/btrfs

The issue is that when enabling quotas, at btrfs\_quota\_enable(), we set
BTRFS\_QGROUP\_STATUS\_FLAG\_SIMPLE\_MODE at fs\_info-\>qgroup\_flags and persist
it in the quota root in the item with the key BTRFS\_QGROUP\_STATUS\_KEY, but
we only set the incompat bit BTRFS\_FEATURE\_INCOMPAT\_SIMPLE\_QUOTA after we
commit the transaction used to enable simple quotas.

This means that if after that transaction commit we unmount the filesystem
without starting and committing any other transaction, or we have a power
failure, the next time we mount the filesystem we will find the flag
BTRFS\_QGROUP\_STATUS\_FLAG\_SIMPLE\_MODE set in the item with the key
BTRFS\_QGROUP\_STATUS\_KEY but we will not find the incompat bit
BTRFS\_FEATURE\_INCOMPAT\_SIMPLE\_QUOTA set in the superblock, triggering an
assertion failure at:

  btrfs\_read\_qgroup\_config() -\> qgroup\_read\_enable\_gen()

To fix this issue, set the BTRFS\_FEATURE\_INCOMPAT\_SIMPLE\_QUOTA flag
immediately after setting the BTRFS\_QGROUP\_STATUS\_FLAG\_SIMPLE\_MODE.
This ensures that both flags are flushed to disk within the same
transaction.

## Affected and fixed versions

- Linux: \>= 182940f4f4dbd932776414744c8de64333957725, \< b87c9b9ba05ba6e8e2ee9ecd29a8c930b35648ed; \>= 182940f4f4dbd932776414744c8de64333957725, \< f2363e6fcc7938c5f0f6ac066fad0dd247598b51 (cvelist)
- Linux: 6.7 (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-57806. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-57806.md
Affected: Linux >= 182940f4f4dbd932776414744c8de64333957725, < b87c9b9ba05ba6e8e2ee9ecd29a8c930b35648ed; >= 182940f4f4dbd932776414744c8de64333957725, < f2363e6fcc7938c5f0f6ac066fad0dd247598b51; Linux 6.7
Fixed in: no fixed version listed yet

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

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

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

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

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

Linux \>= 182940f4f4dbd932776414744c8de64333957725, \< b87c9b9ba05ba6e8e2ee9ecd29a8c930b35648ed; \>= 182940f4f4dbd932776414744c8de64333957725, \< f2363e6fcc7938c5f0f6ac066fad0dd247598b51; Linux 6.7.

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

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

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

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/b87c9b9ba05ba6e8e2ee9ecd29a8c930b35648ed>
- patch: <https://git.kernel.org/stable/c/f2363e6fcc7938c5f0f6ac066fad0dd247598b51>

## 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-57806>

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