]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm crypt: avoid truncating the logical block size
authorEric Biggers <ebiggers@google.com>
Thu, 4 Jun 2020 19:01:26 +0000 (12:01 -0700)
committerMike Snitzer <snitzer@redhat.com>
Fri, 5 Jun 2020 18:59:59 +0000 (14:59 -0400)
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: 47f50cdf5154 ("block: fix an integer overflow in logical block size")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c

index 71c651465bddfd4a1335b21febcd15ec07e5b85e..000ddfab5ba05887e0bfda13baac9327fd0776f1 100644 (file)
@@ -3312,7 +3312,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);