Re: [PATCH] crypto: hisilicon/sec2 - prevent req used-after-free for sec

From: Herbert Xu

Date: Fri Mar 27 2026 - 06:18:57 EST


On Sat, Mar 21, 2026 at 03:00:38PM +0800, Chenghai Huang wrote:
> From: Wenkai Lin <linwenkai6@xxxxxxxxxxxxx>
>
> During packet transmission, if the system is under heavy load,
> the hardware might complete processing the packet and free the
> request memory (req) before the transmission function finishes.
> If the software subsequently accesses this req, a use-after-free
> error will occur. The qp_ctx memory exists throughout the packet
> sending process, so replace the req with the qp_ctx.
>
> Fixes: f0ae287c5045 ("crypto: hisilicon/sec2 - implement full backlog mode for sec")
> Signed-off-by: Wenkai Lin <linwenkai6@xxxxxxxxxxxxx>
> Signed-off-by: Chenghai Huang <huangchenghai2@xxxxxxxxxx>
> ---
> drivers/crypto/hisilicon/sec2/sec_crypto.c | 2 +-
> 1 file changed, 1 insertion(+), 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