CVE-2023-53339: btrfs: fix BUG_ON condition in btrfs_cancel_balance
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
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53339?
CVE-2023-53339 is classified as a high-severity vulnerability due to potential system crashes.
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.
What systems are affected by CVE-2023-53339?
The vulnerability affects versions of the Linux kernel using the btrfs filesystem.
What does CVE-2023-53339 exploit?
CVE-2023-53339 exploits a race condition during the pause and cancel balance operation in the btrfs filesystem.
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.