# CVE-2023-54023: btrfs: fix race between balance and cancel/pause

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.27% (percentile 13, 2026-11-26)
- **Published:** 2025-12-24T10:55:52.835Z
- **Modified:** 2026-06-17T06:46:33.407Z

## Who should check

- Anyone running Linux \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< ddf7e8984c83aee9122552529f4e77291903f8d9; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< 72efe5d44821e38540888a5fe3ff3d0faab6acad; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< b19c98f237cd76981aaded52c258ce93f7daa8cb
- Anyone running Linux 3.3

## Description

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

btrfs: fix race between balance and cancel/pause

Syzbot reported a panic that looks like this:

  assertion failed: fs\_info-\>exclusive\_operation == BTRFS\_EXCLOP\_BALANCE\_PAUSED, in fs/btrfs/ioctl.c:465
  ------------\[ cut here \]------------
  kernel BUG at fs/btrfs/messages.c:259!
  RIP: 0010:btrfs\_assertfail+0x2c/0x30 fs/btrfs/messages.c:259
  Call Trace:
   \<TASK\>
   btrfs\_exclop\_balance fs/btrfs/ioctl.c:465 \[inline\]
   btrfs\_ioctl\_balance fs/btrfs/ioctl.c:3564 \[inline\]
   btrfs\_ioctl+0x531e/0x5b30 fs/btrfs/ioctl.c:4632
   vfs\_ioctl fs/ioctl.c:51 \[inline\]
   \_\_do\_sys\_ioctl fs/ioctl.c:870 \[inline\]
   \_\_se\_sys\_ioctl fs/ioctl.c:856 \[inline\]
   \_\_x64\_sys\_ioctl+0x197/0x210 fs/ioctl.c:856
   do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
   do\_syscall\_64+0x39/0xb0 arch/x86/entry/common.c:80
   entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

The reproducer is running a balance and a cancel or pause in parallel.
The way balance finishes is a bit wonky, if we were paused we need to
save the balance\_ctl in the fs\_info, but clear it otherwise and cleanup.
However we rely on the return values being specific errors, or having a
cancel request or no pause request.  If balance completes and returns 0,
but we have a pause or cancel request we won't do the appropriate
cleanup, and then the next time we try to start a balance we'll trip
this ASSERT.

The error handling is just wrong here, we always want to clean up,
unless we got -ECANCELLED and we set the appropriate pause flag in the
exclusive op.  With this patch the reproducer ran for an hour without
tripping, previously it would trip in less than a few minutes.

## Affected and fixed versions

- Linux: \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< ddf7e8984c83aee9122552529f4e77291903f8d9; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< 72efe5d44821e38540888a5fe3ff3d0faab6acad; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< b19c98f237cd76981aaded52c258ce93f7daa8cb (cvelist)
- Linux: 3.3 (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-2023-54023. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-54023.md
Affected: Linux >= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, < ddf7e8984c83aee9122552529f4e77291903f8d9; >= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, < 72efe5d44821e38540888a5fe3ff3d0faab6acad; >= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, < b19c98f237cd76981aaded52c258ce93f7daa8cb; Linux 3.3
Fixed in: Linux 72efe5d44821e38540888a5fe3ff3d0faab6acad

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

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< ddf7e8984c83aee9122552529f4e77291903f8d9; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< 72efe5d44821e38540888a5fe3ff3d0faab6acad; \>= 837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961, \< b19c98f237cd76981aaded52c258ce93f7daa8cb; Linux 3.3.

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

Yes. Fixed in Linux 72efe5d44821e38540888a5fe3ff3d0faab6acad. No fix listed yet: follow the vendor advisory.

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

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

- other: <https://git.kernel.org/stable/c/ddf7e8984c83aee9122552529f4e77291903f8d9>
- other: <https://git.kernel.org/stable/c/72efe5d44821e38540888a5fe3ff3d0faab6acad>
- other: <https://git.kernel.org/stable/c/b19c98f237cd76981aaded52c258ce93f7daa8cb>

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

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