Re: [PATCH] crypto: tegra - fix rctx->cryptlen in tegra_gcm_do_one_req()

From: Herbert Xu

Date: Sun Jul 19 2026 - 21:20:56 EST


On Sun, Jul 19, 2026 at 07:13:02PM +0200, Vladislav Dronov wrote:
> Perform rctx->cryptlen calculation in tegra_gcm_do_one_req() the same way
> it is done in tegra_ccm_crypt_init(). The current formulae may lead to a
> crash if a caller does not call tegra_gcm_setauthsize() and so ctx->authsize
> remains zero. Then a decrypt operation with incorrect rctx->cryptlen will
> lead to a write beyound rctx->dst_sg buffer.
>
> Signed-off-by: Vladislav Dronov <vdronov@xxxxxxxxxx>
> ---
> drivers/crypto/tegra/tegra-se-aes.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks Vladis.

Please also do a follow-up cleanup that deletes ctx->authsize since
it appears to be completely unused.

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