* [PATCH] crypto: hifn_795x - Free walk pages on session setup failure
@ 2026-11-18 6:19 Haoxiang Li
2026-11-18 6:55 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Haoxiang Li @ 2026-11-18 6:19 UTC (permalink / raw)
To: herbert, davem, johnpol, linux-crypto, linux-kernel; +Cc: Haoxiang Li
hifn_setup_session() allocates temporary pages for misaligned destination
buffers. If the scatterlist walk fails or the hardware queue has
insufficient capacity, these pages are not released. Retrying a queued
request reinitializes the walk cache, losing the previous page pointers.
Add a separate cleanup path to release the pages for misaligned requests.
Fixes: f7d0561ea1da ("[CRYPTO] hifn_795x: HIFN 795x driver")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
drivers/crypto/hifn_795x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 46bcef044606..73a661085d97 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -1539,7 +1539,7 @@ static int hifn_setup_session(struct skcipher_request *req)
sg_num = hifn_cipher_walk(req, &rctx->walk);
if (sg_num < 0) {
err = sg_num;
- goto err_out_exit;
+ goto err_out_free;
}
spin_lock_irqsave(&dev->lock, flags);
@@ -1561,6 +1561,9 @@ static int hifn_setup_session(struct skcipher_request *req)
err_out:
spin_unlock_irqrestore(&dev->lock, flags);
+err_out_free:
+ if (rctx->walk.flags & ASYNC_FLAGS_MISALIGNED)
+ hifn_cipher_walk_exit(&rctx->walk);
err_out_exit:
if (err) {
dev_info(&dev->pdev->dev, "iv: %p [%d], key: %p [%d], mode: %u, op: %u, "
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] crypto: hifn_795x - Free walk pages on session setup failure
2026-11-18 6:19 [PATCH] crypto: hifn_795x - Free walk pages on session setup failure Haoxiang Li
@ 2026-11-18 6:55 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-11-18 6:55 UTC (permalink / raw)
To: Haoxiang Li; +Cc: herbert, davem, johnpol, linux-crypto, linux-kernel
On Wed, Nov 18, 2026 at 02:19:17PM +0800, Haoxiang Li wrote:
> hifn_setup_session() allocates temporary pages for misaligned destination
> buffers. If the scatterlist walk fails or the hardware queue has
> insufficient capacity, these pages are not released. Retrying a queued
> request reinitializes the walk cache, losing the previous page pointers.
> Add a separate cleanup path to release the pages for misaligned requests.
>
> Fixes: f7d0561ea1da ("[CRYPTO] hifn_795x: HIFN 795x driver")
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> drivers/crypto/hifn_795x.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
We should just delete this driver. It is heavily broken, 32-bit only,
and no one seems to have used it since 2008.
- Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-18 6:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 6:19 [PATCH] crypto: hifn_795x - Free walk pages on session setup failure Haoxiang Li
2026-11-18 6:55 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®