]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use kvcalloc for allocation in btrfs_ioctl_send()
authorDenis Efremov <efremov@linux.com>
Mon, 21 Sep 2020 17:03:36 +0000 (20:03 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:13:22 +0000 (12:13 +0200)
commit3a371ed5907c9900cfcd8273a5813f729b496bbd
treeb3646bc6434e34f90442e5eda3849236f8d32e91
parent84c8b636cb458c2fa63cca845526f3ef20e46632
btrfs: use kvcalloc for allocation in btrfs_ioctl_send()

Replace kvzalloc() call with kvcalloc() that also checks the size
internally. There's a standalone overflow check in the function so we
can return invalid parameter combination.  Use array_size() helper to
compute the memory size for clone_sources_tmp.

Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Denis Efremov <efremov@linux.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c