Re: [PATCH V2] block: Fix potential overflow in blk_report_zones()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/9/19 10:53 PM, Damien Le Moal wrote:
> 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.

Applied, thanks.

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux