[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c897b521-0520-429e-9e94-ba7da74a921f@gmail.com>
Date: Wed, 31 Jul 2024 14:41:13 +0200
From: Milan Broz <gmazyland@...il.com>
To: Md Sadre Alam <quic_mdalam@...cinc.com>, axboe@...nel.dk, agk@...hat.com,
snitzer@...nel.org, mpatocka@...hat.com, adrian.hunter@...el.com,
quic_asutoshd@...cinc.com, ritesh.list@...il.com, ulf.hansson@...aro.org,
andersson@...nel.org, konrad.dybcio@...aro.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, dm-devel@...ts.linux.dev,
linux-mmc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
quic_viswanat@...cinc.com, quic_srichara@...cinc.com, quic_varada@...cinc.com
Subject: Re: [PATCH 2/6] md: dm-crypt: Set cc->iv_size to 4 bytes
On 7/30/24 1:58 PM, Md Sadre Alam wrote:
> Set cc->iv_size to 4 bytes instead of 8 bytes, since
> this cc->iv_size is passing as data unit bytes to
> blk_crypto_init_key(). Since CQHCI driver having
> limitation for data unit bytes to 32-bit only.
In dm-crypt, plain64 IV is defined as "little-endian 64bit IV"
and was introduced to fix security problem when 32bit "plain" IV
overflows and IV is reused.
In that case you can move ciphertext sector between places with
the same IV (but different offsets) and these will be still
correctly decrypted.
If I understand it correctly, this reintroduces the same problem here.
If you have 32bit only, just use "plain" and do not support plain64 here.
(In general, I do not understand why you are sending patches
for dm-crypt code that is clearly not upstream.
I hope this code will never be accepted.)
Milan
>
> Signed-off-by: Md Sadre Alam <quic_mdalam@...cinc.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 37add222b169..c0257d961968 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -2490,7 +2490,7 @@ static int crypt_select_inline_crypt_mode(struct dm_target *ti, char *cipher,
> }
>
> if (ivmode == NULL || (strcmp(ivmode, "plain64") == 0)) {
> - cc->iv_size = 8;
> + cc->iv_size = 4;
> } else {
> ti->error = "Invalid IV mode for inline_crypt";
> return -EINVAL;
Powered by blists - more mailing lists