CVE-2023-54158
published 2025-12-24CVE-2023-54158: 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…
PriorityP423
EPSS
0.21%
11.8th percentile
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
Affected
19 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | linux | < linux 6.1.37-1 (bookworm) | linux 6.1.37-1 (bookworm) |
| linux | linux | — | — |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < 1e05bf5e80bb1161b7294c9ce5292b26232ab853 | 1e05bf5e80bb1161b7294c9ce5292b26232ab853 |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < 148b16cd30b202999ec5b534e3e5d8ab4b766f21 | 148b16cd30b202999ec5b534e3e5d8ab4b766f21 |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < f264be24146bee2d652010a18ae2517df5856261 | f264be24146bee2d652010a18ae2517df5856261 |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < 15e877e5923ec6d6caa5e447dcc4b79a8ff7cc53 | 15e877e5923ec6d6caa5e447dcc4b79a8ff7cc53 |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < 04ff6bd0317735791ef3e443c7c89f3c0dda548d | 04ff6bd0317735791ef3e443c7c89f3c0dda548d |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < 478bd15f46b6e3aae78aac4f3788697f1546eea6 | 478bd15f46b6e3aae78aac4f3788697f1546eea6 |
| linux | linux | >= ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a < d246331b78cbef86237f9c22389205bc9b4e1cc1 | d246331b78cbef86237f9c22389205bc9b4e1cc1 |
| linux | linux_kernel | >= 0 < 5.10.191-1 | 5.10.191-1 |
| linux | linux_kernel | >= 0 < 6.1.37-1 | 6.1.37-1 |
| linux | linux_kernel | >= 0 < 6.3.7-1 | 6.3.7-1 |
| linux | linux_kernel | >= 0 < 6.3.7-1 | 6.3.7-1 |
| linux | linux_kernel | >= 4.17.0 < 5.4.243 | 5.4.243 |
| linux | linux_kernel | >= 5.11.0 < 5.15.112 | 5.15.112 |
| linux | linux_kernel | >= 5.16.0 < 6.1.29 | 6.1.29 |
| linux | linux_kernel | >= 5.5.0 < 5.10.180 | 5.10.180 |
| linux | linux_kernel | >= 6.2.0 < 6.2.16 | 6.2.16 |
| linux | linux_kernel | >= 6.3.0 < 6.3.3 | 6.3.3 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
kernel: btrfs: don't free qgroup space unless specified
vendor_redhat·2025-12-24
CVE-2023-54158 kernel: btrfs: don't free qgroup space unless specified
kernel: btrfs: don't free qgroup space unless specified
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_del
Debian
CVE-2023-54158: linux - In the Linux kernel, the following vulnerability has been resolved: btrfs: don'...
vendor_debian·2023
CVE-2023-54158 CVE-2023-54158: linux - In the Linux kernel, the following vulnerability has been resolved: btrfs: don'...
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
GHSA
GHSA-crmq-c99h-f986: In the Linux kernel, the following vulnerability has been resolved:
btrfs: don't free qgroup space unless specified
Boris noticed in his simple quot
ghsa_unreviewed·2025-12-24
CVE-2023-54158 GHSA-crmq-c99h-f986: In the Linux kernel, the following vulnerability has been resolved:
btrfs: don't free qgroup space unless specified
Boris noticed in his simple quot
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
OSV
CVE-2023-54158: In the Linux kernel, the following vulnerability has been resolved: btrfs: don't free qgroup space unless specified Boris noticed in his simple quotas
osv·2025-12-24
CVE-2023-54158 CVE-2023-54158: In the Linux kernel, the following vulnerability has been resolved: btrfs: don't free qgroup space unless specified Boris noticed in his simple quotas
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
OSV
btrfs: don't free qgroup space unless specified
osv·2025-12-24
CVE-2023-54158 btrfs: don't free qgroup space unless specified
btrfs: don't free qgroup space unless specified
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
No detection rules found.
No public exploits indexed.
Wiz
CVE-2023-54158 Impact, Exploitability, and Mitigation Steps | Wiz
blogs_wiz
CVE-2023-54158 CVE-2023-54158 Impact, Exploitability, and Mitigation Steps | Wiz
## CVE-2023-54158 :
Linux Kernel vulnerability analysis and mitigation
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
Bugzilla
CVE-2023-54158 kernel: btrfs: don't free qgroup space unless specified
bugzilla·2025-12-24
CVE-2023-54158 CVE-2023-54158 kernel: btrfs: don't free qgroup space unless specified
CVE-2023-54158 kernel: btrfs: don't free qgroup space unless specified
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
https://git.kernel.org/stable/c/04ff6bd0317735791ef3e443c7c89f3c0dda548dhttps://git.kernel.org/stable/c/148b16cd30b202999ec5b534e3e5d8ab4b766f21https://git.kernel.org/stable/c/15e877e5923ec6d6caa5e447dcc4b79a8ff7cc53https://git.kernel.org/stable/c/1e05bf5e80bb1161b7294c9ce5292b26232ab853https://git.kernel.org/stable/c/478bd15f46b6e3aae78aac4f3788697f1546eea6https://git.kernel.org/stable/c/d246331b78cbef86237f9c22389205bc9b4e1cc1https://git.kernel.org/stable/c/f264be24146bee2d652010a18ae2517df5856261
2025-12-24
Published