Re: [PATCH] block: add capacity validation in bdev_add_partition()

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

 



On Thu, Jun 15, 2023 at 04:09:29PM +0000, min15.li wrote:
> +	if (start >= get_capacity(disk) ||
> +		start + length > get_capacity(disk)) {

We need to check for overflows of the start + length value,
probably best using a helper like check_add_overflow.

Also a single tab indent (and thus the same as code below) is always
wrong for continuations, plase use either two tabs or align to the
opening brace.



[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