diff options
| author | Damien Le Moal <[email protected]> | 2019-07-10 04:53:10 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2019-07-10 15:00:57 +0000 |
| commit | 113ab72ed4794c193509a97d7c6d32a6886e1682 (patch) | |
| tree | 63e80e76c922ae4626bfe1721bb319254a25e985 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | blkcg: implement REQ_CGROUP_PUNT (diff) | |
| download | kernel-113ab72ed4794c193509a97d7c6d32a6886e1682.tar.gz kernel-113ab72ed4794c193509a97d7c6d32a6886e1682.zip | |
block: Fix potential overflow in blk_report_zones()
For large values of the number of zones reported and/or large zone
sizes, the sector increment calculated with
blk_queue_zone_sectors(q) * n
in blk_report_zones() loop can overflow the unsigned int type used for
the calculation as both "n" and blk_queue_zone_sectors() value are
unsigned int. E.g. for a device with 256 MB zones (524288 sectors),
overflow happens with 8192 or more zones reported.
Changing the return type of blk_queue_zone_sectors() to sector_t, fixes
this problem and avoids overflow problem for all other callers of this
helper too. The same change is also applied to the bdev_zone_sectors()
helper.
Fixes: e76239a3748c ("block: add a report_zones method")
Cc: [email protected]
Signed-off-by: Damien Le Moal <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
