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

Herbert Xu <[email protected]>
Newsgroups org.kernel.vger.linux-tegra,org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
> ---
>  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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.