]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Fix -EOVERFLOW handling in btrfs_ioctl_tree_search_v2
authorNikolay Borisov <nborisov@suse.com>
Fri, 4 Aug 2017 11:41:18 +0000 (14:41 +0300)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Aug 2017 14:36:29 +0000 (16:36 +0200)
commit607a3d7ae9326189f42390d81282a7aec64104bd
tree3db951af486430c8f022530c4a25880f4db417d2
parentd6d88c211573de36bfef4e43bd47a4e92c0eed63
btrfs: Fix -EOVERFLOW handling in btrfs_ioctl_tree_search_v2

The buffer passed to btrfs_ioctl_tree_search* functions have to be at least
sizeof(struct btrfs_ioctl_search_header). If this is not the case then the
ioctl should return -EOVERFLOW and set the uarg->buf_size to the minimum
required size. Currently btrfs_ioctl_tree_search_v2 would return an -EOVERFLOW
error with ->buf_size being set to the value passed by user space. Fix this by
removing the size check and relying on search_ioctl, which already includes it
and correctly sets buf_size.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c