]> git.itanic.dy.fi Git - linux-stable/commitdiff
crypto: engine - check if BH is disabled during completion
authorCorentin Labbe <clabbe@baylibre.com>
Mon, 21 Feb 2022 12:08:33 +0000 (12:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:20 +0000 (11:50 +0200)
[ Upstream commit 4058cf08945c18a6de193f4118fd05d83d3d4285 ]

When doing iperf over ipsec with crypto hardware sun8i-ce, I hit some
spinlock recursion bug.

This is due to completion function called with enabled BH.

Add check a to detect this.

Fixes: 735d37b5424b ("crypto: engine - Introduce the block request crypto engine framework")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: 4140aafcff16 ("crypto: engine - fix crypto_queue backlog handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/crypto_engine.c

index cff21f4e03e3214052dfd652583f1e51ab2a1809..fecf6baaa4f7daa21f70dcb181f17cc51681ec8c 100644 (file)
@@ -53,6 +53,7 @@ static void crypto_finalize_request(struct crypto_engine *engine,
                                dev_err(engine->dev, "failed to unprepare request\n");
                }
        }
+       lockdep_assert_in_softirq();
        req->complete(req, err);
 
        kthread_queue_work(engine->kworker, &engine->pump_requests);