summaryrefslogtreecommitdiff
path: root/certs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-02-26 23:41:07 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-19 16:08:45 +0100
commitd11aefe654a04fc41996d254748d6a38b6b0a7be (patch)
tree5b777026ccfd5d32d01c881a8750d52064aa1bbc /certs
parent9273175bf16c83f3ec93aa242d78c9b5db452d4d (diff)
btrfs: fix transaction abort on set received ioctl due to item overflow
commit 87f2c46003fce4d739138aab4af1942b1afdadac upstream. If the set received ioctl fails due to an item overflow when attempting to add the BTRFS_UUID_KEY_RECEIVED_SUBVOL we have to abort the transaction since we did some metadata updates before. This means that if a user calls this ioctl with the same received UUID field for a lot of subvolumes, we will hit the overflow, trigger the transaction abort and turn the filesystem into RO mode. A malicious user could exploit this, and this ioctl does not even requires that a user has admin privileges (CAP_SYS_ADMIN), only that he/she owns the subvolume. Fix this by doing an early check for item overflow before starting a transaction. This is also race safe because we are holding the subvol_sem semaphore in exclusive (write) mode. A test case for fstests will follow soon. Fixes: dd5f9615fc5c ("Btrfs: maintain subvolume items in the UUID tree") CC: stable@vger.kernel.org # 3.12+ Reviewed-by: Anand Jain <asj@kernel.org> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions