diff options
| author | Coly Li <[email protected]> | 2019-02-09 12:53:08 +0800 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2019-02-09 07:18:32 -0700 |
| commit | 453745fbbebecf7e459785db7e29e11563908525 (patch) | |
| tree | f8dd8f67d3f4bc2f92fcdae7604719ff46823843 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | dab71b2db98dcdd4657d151b01a7be88ce10f9d1 (diff) | |
bcache: fix input overflow to journal_delay_ms
c->journal_delay_ms is in type unsigned short, it is set via sysfs
interface and converted by sysfs_strtoul() from input string to
unsigned short value. Therefore overflow to unsigned short might be
happen when the converted value exceed USHRT_MAX. e.g. writing
65536 into sysfs file journal_delay_ms, c->journal_delay_ms is set to
0.
This patch uses sysfs_strtoul_clamp() to convert the input string and
limit value range in [0, USHRT_MAX], to avoid the input 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