CVE-2023-54158
NoneCVSS
—
EPSS
0.2%
Published
Dec 24, 2025
CISA due date
—
Cloudanix analysis
A bug in the Linux storage code could cause reserved space accounting to be lost when creating folders and sub-volumes on certain filesystems, eventually preventing new operations until the system is updated.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- OS kernel
- Class
- Other
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw is an unconditional release of qgroup reservations inside btrfs_block_rsv_release when btrfs_insert_delayed_dir_index skips a reservation on a temporary block rsv created for subvolume creation; because the temporary rsv only sets qgroup_rsv_reserved and leaves qgroup_rsv_size at zero, the optimization zeroes the reservation without ever calling btrfs_qgroup_convert_reserved_meta, leaking the accounted space.
Why it matters to the business
On systems using btrfs with quotas enabled, repeated creation of directories and subvolumes can silently exhaust the qgroup reservation pool, causing subsequent metadata operations to fail and potentially leading to filesystem instability or denial of service for storage workloads.
How an attack unfolds
An attacker with local access and the ability to create directories and subvolumes on a btrfs volume that has qgroups enabled triggers the delayed-dir-index optimization path; the resulting zeroing of the temporary rsv's qgroup reservation is never converted back, producing a persistent leak that accumulates with each operation.
How to fix it
Upgrade the Linux kernel to the commit 1e05bf5e80bb1161b7294c9ce5292b26232ab853 (or any stable branch containing that fix) and reboot; alternatively disable qgroups if they are not required.
How to confirm the fix worked
Verify the running kernel contains commit 1e05bf5e80bb1161b7294c9ce5292b26232ab853 via 'git log' or package version; confirm qgroup reservation accounting no longer leaks by exercising mkdir+subvol-create workloads under quota limits and checking btrfs qgroup show output.
Typical attack path
- Obtain local unprivileged access on a Linux system using btrfs with quotas enabled
- Create a directory followed by a subvolume (or repeat mkdir+subvol create sequences)
- Trigger btrfs_insert_delayed_dir_index which calls btrfs_block_rsv_release on the temporary subvolume rsv
- Observe that qgroup_rsv_reserved is cleared without conversion, leaking the reservation
- Repeat to exhaust qgroup metadata reservations and induce allocation failures
How to detect it
Search kernel logs for repeated btrfs qgroup reservation warnings or ENOSPC errors during subvolume creation; examine auditd or syscall logs for sequences of mkdir followed by btrfs subvolume create operations on qgroup-enabled volumes; no public exploit artifacts are known.
What your security team should do
- Prioritize kernel upgrade to the fixed commit on all btrfs systems that have qgroups enabled
- Monitor EPSS and KEV status; schedule patching within normal change windows unless local testing shows high leak rates
- Temporarily disable qgroups on non-production systems if immediate patching is not feasible
- Add filesystem-type and qgroup-enabled checks to vulnerability scanning playbooks
The record
In the Linux kernel, the following vulnerability has been resolved: btrfs: don't free qgroup space unless specified Boris noticed in his simple quotas testing that he was getting a leak with Sweet Tea's change to subvol create that stopped doing a transaction commit. This was just a side effect of that change. In the delayed inode code we have an optimization that will free extra reservations if we think we can pack a dir item into an already modified leaf. Previously this wouldn't be triggered in the subvolume create case because we'd commit the transaction, it was still possible but much harder to trigger. It could actually be triggered if we did a mkdir && subvol create with qgroups enabled. This occurs because in btrfs_insert_delayed_dir_index(), which gets called when we're adding the dir item, we do the following: btrfs_block_rsv_release(fs_info, trans->block_rsv, bytes, NULL); if we're able to skip reserving space. The problem here is that trans->block_rsv points at the temporary block rsv for the subvolume create, which has qgroup reservations in the block rsv. This is a problem because btrfs_block_rsv_release() will do the following: if (block_rsv->qgroup_rsv_reserved >= block_rsv->qgroup_rsv_size) { qgroup_to_release = block_rsv->qgroup_rsv_reserved - block_rsv->qgroup_rsv_size; block_rsv->qgroup_rsv_reserved = block_rsv->qgroup_rsv_size; } The temporary block rsv just has ->qgroup_rsv_reserved set, ->qgroup_rsv_size == 0. The optimization in btrfs_insert_delayed_dir_index() sets ->qgroup_rsv_reserved = 0. Then later on when we call btrfs_subvolume_release_metadata() which has btrfs_block_rsv_release(fs_info, rsv, (u64)-1, &qgroup_to_release); btrfs_qgroup_convert_reserved_meta(root, qgroup_to_release); qgroup_to_release is set to 0, and we do not convert the reserved metadata space. The problem here is that the block rsv code has been unconditionally messing with ->qgroup_rsv_reserved, because the main place this is used is delalloc, and any time we call btrfs_block_rsv_release() we do it with qgroup_to_release set, and thus do the proper accounting. The subvolume code is the only other code that uses the qgroup reservation stuff, but it's intermingled with the above optimization, and thus was getting its reservation freed out from underneath it and thus leaking the reserved space. The solution is to simply not mess with the qgroup reservations if we don't have qgroup_to_release set. This works with the existing code as anything that messes with the delalloc reservations always have qgroup_to_release set. This fixes the leak that Boris was observing.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Linux | Kernel | 4.17.0 | 5.4.243 |
Related vulnerabilities
- CVE-2026-23226 In the Linux kernel, the following vulnerability has been resolved: ksmbd: add chann_lock… Also affects Kernel
- CVE-2026-23225 In the Linux kernel, the following vulnerability has been resolved: sched/mmcid: Don't… Also affects Kernel
- CVE-2026-23230 In the Linux kernel, the following vulnerability has been resolved: smb: client: split… Also affects Kernel
- CVE-2026-23224 In the Linux kernel, the following vulnerability has been resolved: erofs: fix UAF issue… Also affects Kernel
- CVE-2026-23227 In the Linux kernel, the following vulnerability has been resolved: drm/exynos: vidi: use… Also affects Kernel
- CVE-2026-23223 In the Linux kernel, the following vulnerability has been resolved: xfs: fix UAF in… Also affects Kernel
- CVE-2026-23228 In the Linux kernel, the following vulnerability has been resolved: smb: server: fix leak… Also affects Kernel
- CVE-2026-23229 In the Linux kernel, the following vulnerability has been resolved: crypto: virtio - Add… Also affects Kernel