CVE-2023-53339: btrfs: fix BUG_ON condition in btrfs_cancel_balance

Published Sep 17, 2025
·
Updated

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

btrfs: fix BUGON condition in btrfscancelbalance

Pausing and canceling balance can race to interrupt balance lead to BUGON panic in btrfscancelbalance. The BUGON condition in btrfscancelbalance 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:btrfscancelbalance+0x5cf/0x6a0 Call Trace: <TASK> ? donanosleep+0x60/0x120 ? hrtimernanosleep+0xb7/0x1a0 ? schedcoreclonecookie+0x70/0x70 btrfsioctlbalancectl+0x55/0x70 btrfsioctl+0xa46/0xd20 x64sysioctl+0x7d/0xa0 dosyscall64+0x38/0x80 entrySYSCALL64afterhwframe+0x63/0xcd

Race scenario as follows: > mutexunlock(&fsinfo->balancemutex); > -------------------- > .......issue pause and cancel req in another thread > -------------------- > ret = btrfsbalance(fsinfo); > > mutexlock(&fsinfo->balancemutex); > if (ret == -ECANCELED && atomicread(&fsinfo->balancepausereq)) { > btrfsinfo(fsinfo, "balance: paused"); > btrfsexclopbalance(fsinfo, BTRFSEXCLOPBALANCEPAUSED); > }

Affected Software

13 affected components
Linux Foundation Linux Kernel
Linux Linux kernel<4.19.293
Linux Linux kernel>=4.20<5.4.255
Linux Linux kernel>=5.5<5.10.192
Linux Linux kernel>=5.11<5.15.128
Linux Linux kernel>=5.16<6.1.47
Linux Linux kernel>=6.2<6.4.12
Linux Linux kernel=6.5-rc1
Linux Linux kernel=6.5-rc2
Linux Linux kernel=6.5-rc3
Linux Linux kernel=6.5-rc4
Linux Linux kernel=6.5-rc5
Linux Linux kernel=6.5-rc6

Event History

Sep 17, 2025
CVE Published
via MITRE·02:56 PM
Data Sourced
via MITRE·02:56 PM
Description
Data Sourced
via NVD·03:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2023-53339?

CVE-2023-53339 is classified as a high-severity vulnerability due to potential system crashes.

2

How do I fix CVE-2023-53339?

To fix CVE-2023-53339, upgrade to the patched version of the Linux kernel provided by the maintainers.

3

What systems are affected by CVE-2023-53339?

The vulnerability affects versions of the Linux kernel using the btrfs filesystem.

4

What does CVE-2023-53339 exploit?

CVE-2023-53339 exploits a race condition during the pause and cancel balance operation in the btrfs filesystem.

5

Is there a known workaround for CVE-2023-53339?

There are no recommended workarounds for CVE-2023-53339; upgrading the kernel is the best course of action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203