]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: do not allow non subvolume root targets for snapshot
authorJosef Bacik <josef@toxicpanda.com>
Fri, 15 Dec 2023 15:01:44 +0000 (10:01 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 22:46:51 +0000 (23:46 +0100)
commita8892fd71933126ebae3d60aec5918d4dceaae76
tree83aab9853117ef3cbfa618fd214c4429b672ef3a
parente85a0adacf170634878fffcbf34b725aff3f49ed
btrfs: do not allow non subvolume root targets for snapshot

Our btrfs subvolume snapshot <source> <destination> utility enforces
that <source> is the root of the subvolume, however this isn't enforced
in the kernel.  Update the kernel to also enforce this limitation to
avoid problems with other users of this ioctl that don't have the
appropriate checks in place.

Reported-by: Martin Michaelis <code@mgjm.de>
CC: stable@vger.kernel.org # 4.14+
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c