summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-02-09 12:53:01 +0800
committerJens Axboe <axboe@kernel.dk>2019-02-09 07:18:32 -0700
commit8c27a3953e92eb0b22dbb03d599f543a05f9574e (patch)
treec114e4792522bd136d5e1785cde5e1eac8e1ad39 /drivers/md/raid0.c
parentf54478c6e226bb1540a3e58366601039dfd778e2 (diff)
downloadlinux-8c27a3953e92eb0b22dbb03d599f543a05f9574e.tar.gz
linux-8c27a3953e92eb0b22dbb03d599f543a05f9574e.tar.bz2
linux-8c27a3953e92eb0b22dbb03d599f543a05f9574e.zip
bcache: fix input overflow to sequential_cutoff
People may set sequential_cutoff of a cached device via sysfs file, but current code does not check input value overflow. E.g. if value 4294967295 (UINT_MAX) is written to file sequential_cutoff, its value is 4GB, but if 4294967296 (UINT_MAX + 1) is written into, its value will be 0. This is an unexpected behavior. This patch replaces d_strtoi_h() by sysfs_strtoul_clamp() to convert input string to unsigned integer value, and limit its range in [0, UINT_MAX]. Then the input overflow can be fixed. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/raid0.c')
0 files changed, 0 insertions, 0 deletions