public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Akhil R <akhilrajeev@nvidia.com>
Cc: davem@davemloft.net, thierry.reding@gmail.com,
	jonathanh@nvidia.com, linux-crypto@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] crypto: tegra: Use separate buffer for setkey
Date: Sat, 28 Dec 2024 19:36:14 +0800	[thread overview]
Message-ID: <Z2_iroxlT3C1d1HQ@gondor.apana.org.au> (raw)
In-Reply-To: <20241217161207.72921-2-akhilrajeev@nvidia.com>

On Tue, Dec 17, 2024 at 09:42:01PM +0530, Akhil R wrote:
> The buffer which sends the commands to host1x was shared for all tasks
> in the engine. This causes a problem with the setkey() function as it
> gets called asynchronous to the crypto engine queue. Modifying the same
> cmdbuf in setkey() will corrupt the ongoing host1x task and in turn
> break the encryption/decryption operation. Hence use a separate cmdbuf
> for setkey().
> 
> Fixes:  0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
> ---
>  drivers/crypto/tegra/tegra-se-aes.c  | 16 ++++++++--------
>  drivers/crypto/tegra/tegra-se-hash.c | 13 +++++++------
>  drivers/crypto/tegra/tegra-se-key.c  | 10 ++++++++--
>  drivers/crypto/tegra/tegra-se-main.c | 16 ++++++++++++----
>  drivers/crypto/tegra/tegra-se.h      |  3 ++-
>  5 files changed, 37 insertions(+), 21 deletions(-)

So there is a maximum of 15 key slots? In that case you should not
be allocating them in setkey because there can be a lot more than
15 tfm's in the system.

Since the limit is so low they should only be allocated during an
encryption/decryption operation.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2024-12-28 11:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 16:12 [PATCH 0/7] Tegra Security Engine driver improvements Akhil R
2024-12-17 16:12 ` [PATCH 1/7] crypto: tegra: Use separate buffer for setkey Akhil R
2024-12-28 11:36   ` Herbert Xu [this message]
2024-12-31  4:25     ` Akhil R
2025-01-02  0:58       ` Herbert Xu
2025-01-06  4:11         ` Akhil R
2024-12-17 16:12 ` [PATCH 2/7] crypto: tegra: Do not use fixed size buffers Akhil R
2024-12-17 16:12 ` [PATCH 3/7] crypto: tegra: check retrun value for hash do_one_req Akhil R
2024-12-17 16:12 ` [PATCH 4/7] crypto: tegra: Transfer HASH init function to crypto engine Akhil R
2024-12-17 16:12 ` [PATCH 5/7] crypto: tegra: Fix HASH intermediate result handling Akhil R
2024-12-17 16:12 ` [PATCH 6/7] crypto: tegra: Fix CMAC " Akhil R
2024-12-17 16:12 ` [PATCH 7/7] crypto: tegra: Set IV to NULL explicitly for AES ECB Akhil R

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=Z2_iroxlT3C1d1HQ@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=akhilrajeev@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=jonathanh@nvidia.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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