]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
btrfs: free btrfs_path before copying inodes to userspace
authorAnand Jain <anand.jain@oracle.com>
Thu, 10 Nov 2022 06:06:28 +0000 (11:36 +0530)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:00:32 +0000 (14:00 +0100)
commit56fc24a8b78c7c2e6104809338bf4c0483db4207
treece8bc4be3ba9429bb1688ca1ade707135956f74c
parent5f602d73b5309e2b348fb5c38f2c0618236c38e9
btrfs: free btrfs_path before copying inodes to userspace

[ Upstream commit 418ffb9e3cf6c4e2574d3a732b724916684bd133 ]

btrfs_ioctl_logical_to_ino() frees the search path after the userspace
copy from the temp buffer @inodes. Which potentially can lead to a lock
splat.

Fix this by freeing the path before we copy @inodes to userspace.

CC: stable@vger.kernel.org # 4.19+
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 6b4544a13179ed2bdc125b383984b4dacc638e04)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
fs/btrfs/ioctl.c