From: Milan Broz <gmazyland@gmail.com>
To: Md Sadre Alam <quic_mdalam@quicinc.com>,
axboe@kernel.dk, agk@redhat.com, snitzer@kernel.org,
mpatocka@redhat.com, adrian.hunter@intel.com,
quic_asutoshd@quicinc.com, ritesh.list@gmail.com,
ulf.hansson@linaro.org, andersson@kernel.org,
konrad.dybcio@linaro.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev,
linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
quic_viswanat@quicinc.com, quic_srichara@quicinc.com,
quic_varada@quicinc.com
Subject: Re: [PATCH 2/6] md: dm-crypt: Set cc->iv_size to 4 bytes
Date: Wed, 31 Jul 2024 14:41:13 +0200 [thread overview]
Message-ID: <c897b521-0520-429e-9e94-ba7da74a921f@gmail.com> (raw)
In-Reply-To: <20240730115838.3507302-3-quic_mdalam@quicinc.com>
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@quicinc.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;
next prev parent reply other threads:[~2024-07-31 12:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 11:58 [PATCH 0/6] Add Additional algo mode for inline encryption Md Sadre Alam
2024-07-30 11:58 ` [PATCH 1/6] md: dm-crypt: Fix compilation issue Md Sadre Alam
2024-07-30 11:58 ` [PATCH 2/6] md: dm-crypt: Set cc->iv_size to 4 bytes Md Sadre Alam
2024-07-31 12:41 ` Milan Broz [this message]
2024-08-02 4:21 ` Md Sadre Alam
2024-07-30 11:58 ` [PATCH 3/6] blk-crypto: Add additional algo modes for Inline encryption Md Sadre Alam
2024-07-30 11:58 ` [PATCH 4/6] md: dm-crypt: Add additional algo modes for inline encryption Md Sadre Alam
2024-07-30 11:58 ` [PATCH 5/6] mmc: cqhci: Add additional algo mode " Md Sadre Alam
2024-07-30 11:58 ` [PATCH 6/6] mmc: sdhci-msm: " Md Sadre Alam
2024-07-31 12:48 ` [PATCH 0/6] Add Additional " Mikulas Patocka
2024-07-31 14:18 ` Kamal Dasu
2024-08-02 4:23 ` Md Sadre Alam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c897b521-0520-429e-9e94-ba7da74a921f@gmail.com \
--to=gmazyland@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=agk@redhat.com \
--cc=andersson@kernel.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@lists.linux.dev \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_mdalam@quicinc.com \
--cc=quic_srichara@quicinc.com \
--cc=quic_varada@quicinc.com \
--cc=quic_viswanat@quicinc.com \
--cc=ritesh.list@gmail.com \
--cc=snitzer@kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®