diff options
| author | Coly Li <[email protected]> | 2019-02-09 12:53:09 +0800 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2019-02-09 07:18:32 -0700 |
| commit | b15008403b59955c9fa0c8b55cadd6dae991a4e9 (patch) | |
| tree | 1283e2fdc1b648c3206581a4b8a19278a91181dd /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 453745fbbebecf7e459785db7e29e11563908525 (diff) | |
bcache: fix input overflow to cache set io_error_limit
c->error_limit is in type unsigned int, it is set via cache set sysfs
file io_error_limit. Inside the bcache code, input string is converted
by strtoul_or_return() and set the converted value to c->error_limit.
Because the converted value is unsigned long, and c->error_limit is
unsigned int, if the input is large enought, overflow will happen to
c->error_limit.
This patch uses sysfs_strtoul_clamp() to convert input string, and set
the range in [0, UINT_MAX] to avoid the potential overflow.
Signed-off-by: Coly Li <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions