diff options
| author | Coly Li <colyli@suse.de> | 2019-02-09 07:53:04 +0300 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-02-09 17:18:32 +0300 |
| commit | 369d21a73a241682de019ac5c5209ce3ec627743 (patch) | |
| tree | c977a41c6a5ea172c9fc8057615b957ff0b17cb9 /tools/perf/scripts/python | |
| parent | f5c0b95d2eeb17cf8a81fde0461938d2a79303ab (diff) | |
| download | linux-369d21a73a241682de019ac5c5209ce3ec627743.tar.xz | |
bcache: fix input overflow to writeback_delay
Sysfs file writeback_delay is used to configure dc->writeback_delay
which is type unsigned int. But bcache code uses sysfs_strtoul() to
convert the input string, therefore it might be overflowed if the input
value is too large. E.g. input value is 4294967296 but indeed 0 is
set to dc->writeback_delay.
This patch uses sysfs_strtoul_clamp() to convert the input string and
set the result value range in [0, UINT_MAX] to avoid such unsigned
integer overflow.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
