Skip to content

Commit d88bf6b

Browse files
asjgregkh
authored andcommitted
btrfs: free btrfs_path before copying subvol info to userspace
commit 013c1c5 upstream. btrfs_ioctl_get_subvol_info() frees the search path after the userspace copy from the temp buffer @subvol_info. This can lead to a lock splat warning. Fix this by freeing the path before we copy it to userspace. CC: [email protected] # 4.19+ Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f218b40 commit d88bf6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/ioctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,8 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp)
27882788
}
27892789
}
27902790

2791+
btrfs_free_path(path);
2792+
path = NULL;
27912793
if (copy_to_user(argp, subvol_info, sizeof(*subvol_info)))
27922794
ret = -EFAULT;
27932795

0 commit comments

Comments
 (0)