Re: [PATCH] crypto: safexcel - Unwind SHA3 initialization if HMAC setup fails

From: Herbert Xu

Date: Fri Nov 13 2026 - 14:29:31 EST


On Tue, Nov 03, 2026 at 06:40:30AM +0000, Wentao Liang wrote:
> safexcel_hmac_sha3_cra_init() first initializes the SHA3 context, which
> allocates an ahash fallback. If allocating the shash transform or its
> descriptor fails afterwards, that fallback is not released. The crypto
> core does not invoke cra_exit after cra_init returns an error.
>
> Call safexcel_sha3_cra_exit() on these failure paths to release the
> resources acquired by safexcel_sha3_cra_init().
>
> Fixes: 6c1c09b3dd0c ("crypto: inside-secure - Add HMAC-SHA3 family of authentication algorithms")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> drivers/crypto/inside-secure/safexcel_hash.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)

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