diff options
| author | ZHOU Jiaxiang <me@fxti.xyz> | 2026-09-16 21:58:22 +0800 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-09-16 10:11:45 -0400 |
| commit | b6ec0f79745967c751c85df373062c8d15e45fc4 (patch) | |
| tree | fc754a1f31a553f93588169316e6e503dad389f1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 7c431d61b69a3fd0784c20aa4cd0b8fb501b5653 (diff) | |
| download | linux-next-b6ec0f79745967c751c85df373062c8d15e45fc4.tar.gz linux-next-b6ec0f79745967c751c85df373062c8d15e45fc4.zip | |
scsi: sd_zbc: Reject disks with too many zones
sd_zbc_read_zones() computes the number of zones with 64-bit arithmetic and
stores the result in the unsigned int nr_zones field of struct
zoned_disk_info, silently truncating counts that exceed 32 bits. The
truncated count is later used to size per-zone resources, while the device
may still report more zones than fit.
Moreover, sd_zbc_report_zones() counts the reported zones with a signed int
zone_idx, which overflows past INT_MAX. Reject devices reporting more than
INT_MAX zones at scan time; such a device is not realistic for any medium
that exists today, and accepting it produces inconsistent zone bookkeeping.
Fixes: 89d947561077 ("sd: Implement support for ZBC devices")
Signed-off-by: ZHOU Jiaxiang <me@fxti.xyz>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/C41798AB5AA6BF2B+20260916135822.32584-3-me@fxti.xyz
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
