Skip to contentSkip to conversation

FAILED: patch "[PATCH] crypto: omap-sham - fix crypto engine cleanup" failed to apply to 5.10-stable tree

PATCH New Sasha Levin 1 participant 2 messages Nov 7 – Nov 10

Subsystems (2)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x be51ea091c6563158531e8c74e040552fdb1e28c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From be51ea091c6563158531e8c74e040552fdb1e28c Mon Sep 17 00:00:00 2001
From: Guangshuo Li <[email protected]>
Date: Sat, 12 Sep 2026 22:46:08 +0800
Subject: [PATCH] crypto: omap-sham - fix crypto engine cleanup

omap_sham_probe() allocates and starts a crypto engine, but the remove path does not call the matching crypto_engine_exit(). The probe failure path already performs this cleanup.

crypto_engine_alloc_init() creates a kthread worker for processing requests. Without crypto_engine_exit() during driver removal, the worker is left running after the device is removed.

Call crypto_engine_exit() after unregistering the algorithms and before tearing down the remaining request handling resources. This stops the engine and destroys its worker.

This issue was found by manual code inspection.

Fixes 133c3d434d91 ("crypto: omap-sham - convert to use crypto engine")
---
 drivers/crypto/omap-sham.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/omap-sham.c +1 -0
index 12d6dc68438a7..5e739415a0102 100644
@@ -2129,6 +2129,7 @@ static void omap_sham_remove(struct platform_device *pdev)
 	list_del(&dd->list);
 	spin_unlock_bh(&sham.lock);
 	omap_sham_unregister_algs(dd->pdata);
+	crypto_engine_exit(dd->engine);
 	cancel_work_sync(&dd->done_task);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/1 crypto: omap-sham - fix crypto engine cleanup

From: Guangshuo Li <[email protected]>

[ Upstream commit be51ea091c6563158531e8c74e040552fdb1e28c ]

omap_sham_probe() allocates and starts a crypto engine, but the remove path does not call the matching crypto_engine_exit(). The probe failure path already performs this cleanup.

crypto_engine_alloc_init() creates a kthread worker for processing requests. Without crypto_engine_exit() during driver removal, the worker is left running after the device is removed.

Call crypto_engine_exit() after unregistering the algorithms and before tearing down the remaining request handling resources. This stops the engine and destroys its worker.

This issue was found by manual code inspection.

Fixes 133c3d434d91 ("crypto: omap-sham - convert to use crypto engine")
[ sashal: adjusted cleanup context to match the existing inline unregister loops and tasklet_kill() ]
---
 drivers/crypto/omap-sham.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/omap-sham.c +1 -0
index 5a57617441b81..b2e1617474553 100644
@@ -2223,6 +2223,7 @@ static int omap_sham_remove(struct platform_device *pdev)
 					&dd->pdata->algs_info[i].algs_list[j]);
 			dd->pdata->algs_info[i].registered--;
 		}
+	crypto_engine_exit(dd->engine);
 	tasklet_kill(&dd->done_task);
 	pm_runtime_disable(&pdev->dev);
 
Signature · 1 line
2.53.0