From patchwork Thu Jun 4 19:01:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 11588277 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66C991391 for ; Thu, 4 Jun 2020 19:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EDFC207D3 for ; Thu, 4 Jun 2020 19:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591297446; bh=eulf8YWx/Madi2SxQ2AuCbVjnYllknbaJpYGNL3tLwM=; h=From:To:Cc:Subject:Date:List-ID:From; b=MINAcb1ZECZDUWsxLgglOQkJjWv7/OIhT20n+o00X0B6pY7+LQejpxapgzQVRCGsM BDaoo1PPUd6+w7xe9ffWYNqmUd4PZsajFmwMaq0oR1PDRrF6CIhdSMVYgMivymUDl/ 1DM7y9MGHBfZNfXgPkyYFQuxpctf2wyyTipsb8Nw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729284AbgFDTEF (ORCPT ); Thu, 4 Jun 2020 15:04:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:33676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728967AbgFDTEE (ORCPT ); Thu, 4 Jun 2020 15:04:04 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BBF17206C3; Thu, 4 Jun 2020 19:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591297443; bh=eulf8YWx/Madi2SxQ2AuCbVjnYllknbaJpYGNL3tLwM=; h=From:To:Cc:Subject:Date:From; b=h/RVHQI4PXglXk0M2xhL6qwhLDoqz7/50ASkfljg46CDbi0KUi9z27WnbcxAXvdxr yyrwgBKw9IkjJu3OoMnnLx1SyjsGcnXTpD/LhPejIGS0WtiUxSX6/mz3UXrvEBUXEi Dp2lH0Ism1XCs6Kbhg+szqPDx4YVqHBDqFd8vtAY= From: Eric Biggers To: dm-devel@redhat.com, Alasdair Kergon , Mike Snitzer Cc: linux-block@vger.kernel.org, Mikulas Patocka , stable@vger.kernel.org Subject: [PATCH] dm crypt: avoid truncating the logical block size Date: Thu, 4 Jun 2020 12:01:26 -0700 Message-Id: <20200604190126.15735-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Eric Biggers 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 Reviewed-by: Mikulas Patocka --- 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);