# CVE-2023-53339: btrfs: fix BUG\_ON condition in btrfs\_cancel\_balance

> 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-30)
- **CWE:** CWE-617
- **Published:** 2025-09-17T14:56:33.114Z
- **Modified:** 2026-06-17T06:44:56.297Z

## Who should check

- Anyone running Linux \>= ddf7e8984c83aee9122552529f4e77291903f8d9, \< ceb9ba8e30833a4823e2dc73f80ebcdf2498d01a; \>= 72efe5d44821e38540888a5fe3ff3d0faab6acad, \< ae81329f7de3aa6f34ecdfa5412e72161a30e9ce; \>= b19c98f237cd76981aaded52c258ce93f7daa8cb, \< 29eefa6d0d07e185f7bfe9576f91e6dba98189c2
- Anyone running Linux \>= 6.1.42, \< 6.1.47; \>= 6.4.7, \< 6.4.12

## Description

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

btrfs: fix BUG\_ON condition in btrfs\_cancel\_balance

Pausing and canceling balance can race to interrupt balance lead to BUG\_ON
panic in btrfs\_cancel\_balance. The BUG\_ON condition in btrfs\_cancel\_balance
does not take this race scenario into account.

However, the race condition has no other side effects. We can fix that.

Reproducing it with panic trace like this:

  kernel BUG at fs/btrfs/volumes.c:4618!
  RIP: 0010:btrfs\_cancel\_balance+0x5cf/0x6a0
  Call Trace:
   \<TASK\>
   ? do\_nanosleep+0x60/0x120
   ? hrtimer\_nanosleep+0xb7/0x1a0
   ? sched\_core\_clone\_cookie+0x70/0x70
   btrfs\_ioctl\_balance\_ctl+0x55/0x70
   btrfs\_ioctl+0xa46/0xd20
   \_\_x64\_sys\_ioctl+0x7d/0xa0
   do\_syscall\_64+0x38/0x80
   entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

  Race scenario as follows:
  \> mutex\_unlock(&fs\_info-\>balance\_mutex);
  \> --------------------
  \> .......issue pause and cancel req in another thread
  \> --------------------
  \> ret = \_\_btrfs\_balance(fs\_info);
  \>
  \> mutex\_lock(&fs\_info-\>balance\_mutex);
  \> if (ret == -ECANCELED && atomic\_read(&fs\_info-\>balance\_pause\_req)) {
  \>         btrfs\_info(fs\_info, "balance: paused");
  \>         btrfs\_exclop\_balance(fs\_info, BTRFS\_EXCLOP\_BALANCE\_PAUSED);
  \> }

## Affected and fixed versions

- Linux: \>= ddf7e8984c83aee9122552529f4e77291903f8d9, \< ceb9ba8e30833a4823e2dc73f80ebcdf2498d01a; \>= 72efe5d44821e38540888a5fe3ff3d0faab6acad, \< ae81329f7de3aa6f34ecdfa5412e72161a30e9ce; \>= b19c98f237cd76981aaded52c258ce93f7daa8cb, \< 29eefa6d0d07e185f7bfe9576f91e6dba98189c2 (cvelist)
- Linux: \>= 6.1.42, \< 6.1.47; \>= 6.4.7, \< 6.4.12 (cvelist)

## Mitigation

- Upgrade Linux to 29eefa6d0d07e185f7bfe9576f91e6dba98189c2 or later.
- Upgrade Linux to 6.4.12 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-53339. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53339.md
Affected: Linux >= ddf7e8984c83aee9122552529f4e77291903f8d9, < ceb9ba8e30833a4823e2dc73f80ebcdf2498d01a; >= 72efe5d44821e38540888a5fe3ff3d0faab6acad, < ae81329f7de3aa6f34ecdfa5412e72161a30e9ce; >= b19c98f237cd76981aaded52c258ce93f7daa8cb, < 29eefa6d0d07e185f7bfe9576f91e6dba98189c2; Linux >= 6.1.42, < 6.1.47;…
Fixed in: Linux 29eefa6d0d07e185f7bfe9576f91e6dba98189c2, Linux 6.1.47, Linux 6.4.12

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

There is no confirmed exploitation: CVE-2023-53339 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-30).

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

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

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

Linux \>= ddf7e8984c83aee9122552529f4e77291903f8d9, \< ceb9ba8e30833a4823e2dc73f80ebcdf2498d01a; \>= 72efe5d44821e38540888a5fe3ff3d0faab6acad, \< ae81329f7de3aa6f34ecdfa5412e72161a30e9ce; \>= b19c98f237cd76981aaded52c258ce93f7daa8cb, \< 29eefa6d0d07e185f7bfe9576f91e6dba98189c2; Linux \>= 6.1.42, \< 6.1.47; \>= 6.4.7, \< 6.4.12.

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

Yes. Fixed in Linux 29eefa6d0d07e185f7bfe9576f91e6dba98189c2, Linux 6.1.47, Linux 6.4.12. Upgrade Linux to 29eefa6d0d07e185f7bfe9576f91e6dba98189c2 or later. Upgrade Linux to 6.4.12 or later.

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

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/ceb9ba8e30833a4823e2dc73f80ebcdf2498d01a>
- patch: <https://git.kernel.org/stable/c/ae81329f7de3aa6f34ecdfa5412e72161a30e9ce>
- patch: <https://git.kernel.org/stable/c/29eefa6d0d07e185f7bfe9576f91e6dba98189c2>

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

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