btrfs: don't free qgroup space unless specified
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ff6bc37eb7f6e7b052e50c13a480e1080b3ec07a · < 478bd15f46b6e3aae78aac4f3788697f1546eea6| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's btrfs code can leak reserved quota metadata space when subvolumes are created with quota groups enabled; a mkdir followed by subvolume creation could trigger it. The input does not establish an attacker path, authentication requirement, or user-interaction requirement.
Administrators running Linux kernels with btrfs quota groups enabled should check their kernel versions; affected versions are not specified.