Re: [PATCH] crypto: ixp4xx - Free the fallback cipher if context initialization fails

From: Herbert Xu

Date: Fri Nov 13 2026 - 16:07:15 EST


On Tue, Nov 03, 2026 at 06:29:42AM +0000, Wentao Liang wrote:
> init_tfm_ablk() allocates a fallback skcipher before calling init_tfm().
> If allocating either security association context fails, init_tfm()
> returns an error and the fallback is left allocated. The crypto core
> does not call the algorithm exit callback after a failed initialization,
> so exit_tfm_ablk() cannot release it.
>
> Free the fallback cipher when init_tfm() fails. The security association
> contexts are already unwound by init_tfm().
>
> Fixes: dfb098d692ea ("crypto: ixp4xx - fallback when having more than one SG")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)

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