mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 17:49:03 +02:00
bcachefs: bch2_ioctl_disk_resize_journal(): check for integer truncation
Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
75e0c4789b
commit
4b33a1916a
1 changed files with 3 additions and 0 deletions
|
|
@ -627,6 +627,9 @@ static long bch2_ioctl_disk_resize_journal(struct bch_fs *c,
|
|||
arg.pad)
|
||||
return -EINVAL;
|
||||
|
||||
if (arg.nbuckets > U32_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
ca = bch2_device_lookup(c, arg.dev, arg.flags);
|
||||
if (IS_ERR(ca))
|
||||
return PTR_ERR(ca);
|
||||
|
|
|
|||
Loading…
Reference in a new issue