* [PATCH] dm crypt: avoid truncating the logical block size
@ 2020-06-04 19:01 Eric Biggers
2020-06-04 19:14 ` Mikulas Patocka
0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2020-06-04 19:01 UTC (permalink / raw)
To: dm-devel, Alasdair Kergon, Mike Snitzer
Cc: linux-block, Mikulas Patocka, stable
From: Eric Biggers <ebiggers@google.com>
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@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dm crypt: avoid truncating the logical block size
2020-06-04 19:01 [PATCH] dm crypt: avoid truncating the logical block size Eric Biggers
@ 2020-06-04 19:14 ` Mikulas Patocka
0 siblings, 0 replies; 2+ messages in thread
From: Mikulas Patocka @ 2020-06-04 19:14 UTC (permalink / raw)
To: Eric Biggers; +Cc: dm-devel, Alasdair Kergon, Mike Snitzer, linux-block, stable
On Thu, 4 Jun 2020, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> 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@vger.kernel.org
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-04 19:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-04 19:01 [PATCH] dm crypt: avoid truncating the logical block size Eric Biggers
2020-06-04 19:14 ` Mikulas Patocka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).