# CVE-2023-52897: btrfs: qgroup: do not warn on record without old\_roots populated

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

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.25% (percentile 10, 2026-11-26)
- **Published:** 2024-08-21T06:10:37.316Z
- **Modified:** 2026-06-17T06:43:53.187Z

## Who should check

- Anyone running Linux \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< bb2c2e62539f2b63c5e0beb51501d328260c7595; \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< 75181406b4eafacc531ff2ee5fb032bd93317e2b
- Anyone running Linux 6.1

## Description

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

btrfs: qgroup: do not warn on record without old\_roots populated

\[BUG\]
There are some reports from the mailing list that since v6.1 kernel, the
WARN\_ON() inside btrfs\_qgroup\_account\_extent() gets triggered during
rescan:

  WARNING: CPU: 3 PID: 6424 at fs/btrfs/qgroup.c:2756 btrfs\_qgroup\_account\_extents+0x1ae/0x260 \[btrfs\]
  CPU: 3 PID: 6424 Comm: snapperd Tainted: P           OE      6.1.2-1-default \#1 openSUSE Tumbleweed 05c7a1b1b61d5627475528f71f50444637b5aad7
  RIP: 0010:btrfs\_qgroup\_account\_extents+0x1ae/0x260 \[btrfs\]
  Call Trace:
   \<TASK\>
  btrfs\_commit\_transaction+0x30c/0xb40 \[btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6\]
   ? start\_transaction+0xc3/0x5b0 \[btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6\]
  btrfs\_qgroup\_rescan+0x42/0xc0 \[btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6\]
   btrfs\_ioctl+0x1ab9/0x25c0 \[btrfs c39c9c546c241c593f03bd6d5f39ea1b676250f6\]
   ? \_\_rseq\_handle\_notify\_resume+0xa9/0x4a0
   ? mntput\_no\_expire+0x4a/0x240
   ? \_\_seccomp\_filter+0x319/0x4d0
   \_\_x64\_sys\_ioctl+0x90/0xd0
   do\_syscall\_64+0x5b/0x80
   ? syscall\_exit\_to\_user\_mode+0x17/0x40
   ? do\_syscall\_64+0x67/0x80
  entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd
  RIP: 0033:0x7fd9b790d9bf
   \</TASK\>

\[CAUSE\]
Since commit e15e9f43c7ca ("btrfs: introduce
BTRFS\_QGROUP\_RUNTIME\_FLAG\_NO\_ACCOUNTING to skip qgroup accounting"), if
our qgroup is already in inconsistent state, we will no longer do the
time-consuming backref walk.

This can leave some qgroup records without a valid old\_roots ulist.
Normally this is fine, as btrfs\_qgroup\_account\_extents() would also skip
those records if we have NO\_ACCOUNTING flag set.

But there is a small window, if we have NO\_ACCOUNTING flag set, and
inserted some qgroup\_record without a old\_roots ulist, but then the user
triggered a qgroup rescan.

During btrfs\_qgroup\_rescan(), we firstly clear NO\_ACCOUNTING flag, then
commit current transaction.

And since we have a qgroup\_record with old\_roots = NULL, we trigger the
WARN\_ON() during btrfs\_qgroup\_account\_extents().

\[FIX\]
Unfortunately due to the introduction of NO\_ACCOUNTING flag, the
assumption that every qgroup\_record would have its old\_roots populated
is no longer correct.

Fix the false alerts and drop the WARN\_ON().

## Affected and fixed versions

- Linux: \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< bb2c2e62539f2b63c5e0beb51501d328260c7595; \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< 75181406b4eafacc531ff2ee5fb032bd93317e2b (cvelist)
- Linux: 6.1 (cvelist)

## Mitigation

- Upgrade Linux to 75181406b4eafacc531ff2ee5fb032bd93317e2b or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2023-52897.md
Affected: Linux >= e15e9f43c7ca25603fcf4c20d44ec777726f1034, < bb2c2e62539f2b63c5e0beb51501d328260c7595; >= e15e9f43c7ca25603fcf4c20d44ec777726f1034, < 75181406b4eafacc531ff2ee5fb032bd93317e2b; Linux 6.1
Fixed in: Linux 75181406b4eafacc531ff2ee5fb032bd93317e2b

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-2023-52897 being exploited?

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

### How serious is CVE-2023-52897?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2023-52897?

Linux \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< bb2c2e62539f2b63c5e0beb51501d328260c7595; \>= e15e9f43c7ca25603fcf4c20d44ec777726f1034, \< 75181406b4eafacc531ff2ee5fb032bd93317e2b; Linux 6.1.

### Is there a fix for CVE-2023-52897?

Yes. Fixed in Linux 75181406b4eafacc531ff2ee5fb032bd93317e2b. Upgrade Linux to 75181406b4eafacc531ff2ee5fb032bd93317e2b or later.

### How do I check if I'm affected by CVE-2023-52897?

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/bb2c2e62539f2b63c5e0beb51501d328260c7595>
- patch: <https://git.kernel.org/stable/c/75181406b4eafacc531ff2ee5fb032bd93317e2b>

## 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-2023-52897>

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