diff options
author | Coly Li <colyli@suse.de> | 2019-02-09 12:53:10 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-02-09 07:18:33 -0700 |
commit | a91fbda49f746119828f7e8ad0f0aa2ab0578f65 (patch) | |
tree | 146a7c1d8048648530d36fd11ec0e31a1557373f /block | |
parent | b15008403b59955c9fa0c8b55cadd6dae991a4e9 (diff) | |
download | linux-a91fbda49f746119828f7e8ad0f0aa2ab0578f65.tar.bz2 |
bcache: fix input overflow to cache set sysfs file io_error_halflife
Cache set sysfs entry io_error_halflife is used to set c->error_decay.
c->error_decay is in type unsigned int, and it is converted by
strtoul_or_return(), therefore overflow to c->error_decay is possible
for a large input value.
This patch fixes the overflow by using strtoul_safe_clamp() to convert
input string to an unsigned long value in range [0, UINT_MAX], then
divides by 88 and set it to c->error_decay.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions