Commit 4b33a191 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_ioctl_disk_resize_journal(): check for integer truncation

Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 75e0c478
...@@ -627,6 +627,9 @@ static long bch2_ioctl_disk_resize_journal(struct bch_fs *c, ...@@ -627,6 +627,9 @@ static long bch2_ioctl_disk_resize_journal(struct bch_fs *c,
arg.pad) arg.pad)
return -EINVAL; return -EINVAL;
if (arg.nbuckets > U32_MAX)
return -EINVAL;
ca = bch2_device_lookup(c, arg.dev, arg.flags); ca = bch2_device_lookup(c, arg.dev, arg.flags);
if (IS_ERR(ca)) if (IS_ERR(ca))
return PTR_ERR(ca); return PTR_ERR(ca);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment