* [patch] btrfs: send: silence an integer overflow warning
@ 2016-04-13 6:40 Dan Carpenter
2016-04-25 12:49 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-04-13 6:40 UTC (permalink / raw)
To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors
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 <dan.carpenter@oracle.com>
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 73dd5d6..6a8c860 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -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)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] btrfs: send: silence an integer overflow warning
2016-04-13 6:40 [patch] btrfs: send: silence an integer overflow warning Dan Carpenter
@ 2016-04-25 12:49 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2016-04-25 12:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
kernel-janitors
On Wed, Apr 13, 2016 at 09:40:59AM +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-25 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-13 6:40 [patch] btrfs: send: silence an integer overflow warning Dan Carpenter
2016-04-25 12:49 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).