# CVE-2024-42111: btrfs: always do the basic checks for btrfs\_qgroup\_inherit structure

> 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.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2024-07-30T07:46:05.570Z
- **Modified:** 2026-08-05T11:35:43.268Z

## Who should check

- Anyone running Linux \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< ebe5ea02577b2c527958af1b76ac472c7ab53a56; \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< 724d8042cef84496ddb4492dc120291f997ae26b; c839f73a70f312f477225b64020364e108f08231; \>= 6.8.10, \< 6.9
- Anyone running Linux 6.9

## Description

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

btrfs: always do the basic checks for btrfs\_qgroup\_inherit structure

\[BUG\]
Syzbot reports the following regression detected by KASAN:

  BUG: KASAN: slab-out-of-bounds in btrfs\_qgroup\_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277
  Read of size 8 at addr ffff88814628ca50 by task syz-executor318/5171

  CPU: 0 PID: 5171 Comm: syz-executor318 Not tainted 6.10.0-rc2-syzkaller-00010-g2ab795141095 \#0
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
  Call Trace:
   \<TASK\>
   \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
   dump\_stack\_lvl+0x241/0x360 lib/dump\_stack.c:114
   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
   btrfs\_qgroup\_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277
   create\_pending\_snapshot+0x1359/0x29b0 fs/btrfs/transaction.c:1854
   create\_pending\_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1922
   btrfs\_commit\_transaction+0xf20/0x3740 fs/btrfs/transaction.c:2382
   create\_snapshot+0x6a1/0x9e0 fs/btrfs/ioctl.c:875
   btrfs\_mksubvol+0x58f/0x710 fs/btrfs/ioctl.c:1029
   btrfs\_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1075
   \_\_btrfs\_ioctl\_snap\_create+0x387/0x4b0 fs/btrfs/ioctl.c:1340
   btrfs\_ioctl\_snap\_create\_v2+0x1f2/0x3a0 fs/btrfs/ioctl.c:1422
   btrfs\_ioctl+0x99e/0xc60
   vfs\_ioctl fs/ioctl.c:51 \[inline\]
   \_\_do\_sys\_ioctl fs/ioctl.c:907 \[inline\]
   \_\_se\_sys\_ioctl+0xfc/0x170 fs/ioctl.c:893
   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
  RIP: 0033:0x7fcbf1992509
  RSP: 002b:00007fcbf1928218 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
  RAX: ffffffffffffffda RBX: 00007fcbf1a1f618 RCX: 00007fcbf1992509
  RDX: 0000000020000280 RSI: 0000000050009417 RDI: 0000000000000003
  RBP: 00007fcbf1a1f610 R08: 00007ffea1298e97 R09: 0000000000000000
  R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcbf19eb660
  R13: 00000000200002b8 R14: 00007fcbf19e60c0 R15: 0030656c69662f2e
   \</TASK\>

And it also pinned it down to commit b5357cb268c4 ("btrfs: qgroup: do not
check qgroup inherit if qgroup is disabled").

\[CAUSE\]
That offending commit skips the whole qgroup inherit check if qgroup is
not enabled.

But that also skips the very basic checks like
num\_ref\_copies/num\_excl\_copies and the structure size checks.

Meaning if a qgroup enable/disable race is happening at the background,
and we pass a btrfs\_qgroup\_inherit structure when the qgroup is
disabled, the check would be completely skipped.

Then at the time of transaction commitment, qgroup is re-enabled and
btrfs\_qgroup\_inherit() is going to use the incorrect structure and
causing the above KASAN error.

\[FIX\]
Make btrfs\_qgroup\_check\_inherit() only skip the source qgroup checks.
So that even if invalid btrfs\_qgroup\_inherit structure is passed in, we
can still reject invalid ones no matter if qgroup is enabled or not.

Furthermore we do already have an extra safety inside
btrfs\_qgroup\_inherit(), which would just ignore invalid qgroup sources,
so even if we only skip the qgroup source check we're still safe.

## Affected and fixed versions

- Linux: \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< ebe5ea02577b2c527958af1b76ac472c7ab53a56; \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< 724d8042cef84496ddb4492dc120291f997ae26b; c839f73a70f312f477225b64020364e108f08231; \>= 6.8.10, \< 6.9 (cvelist)
- Linux: 6.9 (cvelist)

## Mitigation

- Upgrade Linux to 6.9 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-42111. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-42111.md
Affected: Linux >= b5357cb268c41b4e2b7383d2759fc562f5b58c33, < ebe5ea02577b2c527958af1b76ac472c7ab53a56; >= b5357cb268c41b4e2b7383d2759fc562f5b58c33, < 724d8042cef84496ddb4492dc120291f997ae26b; c839f73a70f312f477225b64020364e108f08231; >= 6.8.10, < 6.9; Linux 6.9
Fixed in: Linux 724d8042cef84496ddb4492dc120291f997ae26b, Linux 6.9

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

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

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

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

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

Linux \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< ebe5ea02577b2c527958af1b76ac472c7ab53a56; \>= b5357cb268c41b4e2b7383d2759fc562f5b58c33, \< 724d8042cef84496ddb4492dc120291f997ae26b; c839f73a70f312f477225b64020364e108f08231; \>= 6.8.10, \< 6.9; Linux 6.9.

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

Yes. Fixed in Linux 724d8042cef84496ddb4492dc120291f997ae26b, Linux 6.9. Upgrade Linux to 6.9 or later.

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

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/ebe5ea02577b2c527958af1b76ac472c7ab53a56>
- patch: <https://git.kernel.org/stable/c/724d8042cef84496ddb4492dc120291f997ae26b>

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

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