Re: [PATCH] dm crypt: avoid truncating the logical block size

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

 




On Thu, 4 Jun 2020, Eric Biggers wrote:

> From: Eric Biggers <ebiggers@xxxxxxxxxx>
> 
> queue_limits::logical_block_size got changed from unsigned short to
> unsigned int, but it was forgotten to update crypt_io_hints() to use the
> new type.  Fix it.
> 
> Fixes: ad6bf88a6c19 ("block: fix an integer overflow in logical block size")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>

Reviewed-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>

> ---
>  drivers/md/dm-crypt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index 3df90daba89e..a1dcb8675484 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -3274,7 +3274,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)
>  	limits->max_segment_size = PAGE_SIZE;
>  
>  	limits->logical_block_size =
> -		max_t(unsigned short, limits->logical_block_size, cc->sector_size);
> +		max_t(unsigned, limits->logical_block_size, cc->sector_size);
>  	limits->physical_block_size =
>  		max_t(unsigned, limits->physical_block_size, cc->sector_size);
>  	limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size);
> -- 
> 2.27.0.278.ge193c7cf3a9-goog
> 




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux