[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8pa15wREUvWO1L8@gondor.apana.org.au>
Date: Fri, 20 Jan 2023 17:11:51 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Vincent Whitchurch <vincent.whitchurch@...s.com>
Cc: davem@...emloft.net, jesper.nilsson@...s.com,
lars.persson@...s.com, kernel@...s.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/12] crypto: axis - do not DMA to IV
On Tue, Jan 10, 2023 at 02:50:32PM +0100, Vincent Whitchurch wrote:
> The crypto API does not promise that the IV buffer is suitable for DMA.
> Use an intermediate buffer instead.
>
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@...s.com>
> ---
> drivers/crypto/axis/artpec6_crypto.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
> index 87af44ac3e64..d3b6ee065a81 100644
> --- a/drivers/crypto/axis/artpec6_crypto.c
> +++ b/drivers/crypto/axis/artpec6_crypto.c
> @@ -321,6 +321,7 @@ struct artpec6_crypto_request_context {
> u32 cipher_md;
> bool decrypt;
> struct artpec6_crypto_req_common common;
> + unsigned char iv_bounce[AES_BLOCK_SIZE] CRYPTO_MINALIGN_ATTR;
Please use the newly introduced CRYPTO_DMA_ALIGN macro.
CRYPTO_MINALIGN only reflects minimum kmalloc alignment, which
may be less than that required for DMA. You're currently safe
on arm32, but we should not rely on this in new code.
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists