btrfs: send: silence an integer overflow warning
Subsystems (2)
PATCH 1/1 btrfs: send: silence an integer overflow warning
The "sizeof(*arg->clone_sources) * arg->clone_sources_count" expression can overflow. It causes several static checker warnings. It's all under CAP_SYS_ADMIN so it's not that serious but lets silence the warnings.
Signed-off-by Dan Carpenter <[email protected]>
fs/btrfs/send.c +6 -0
@@ -5979,6 +5979,12 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) goto out; } +if (arg->clone_sources_count > +ULLONG_MAX /sizeof (*arg->clone_sources)) { + ret = -EINVAL ; + goto out; + } +if (!access_ok (VERIFY_READ , arg->clone_sources,sizeof (*arg->clone_sources) * arg->clone_sources_count)) {
Quoted 6 lines · Dan Carpenter
The "
sizeof(*arg->clone_sources)*arg->clone_sources_count" expression can overflow. It causes several static checker warnings. It's all underCAP_SYS_ADMINso it's not that serious but lets silence the warnings.Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by David Sterba <[email protected]>