提交 66bc3b0b 编写于 作者: C Corentin Labbe 提交者: Zheng Zengkai

crypto: sun8i-ss - call finalize with bh disabled

stable inclusion
from stable-v5.10.110
commit bf4814d58b1b1589ec205ffb180f365023d9b4c6
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bf4814d58b1b1589ec205ffb180f365023d9b4c6

--------------------------------

[ Upstream commit b169b376 ]

Doing ipsec produces a spinlock recursion warning.
This is due to not disabling BH during crypto completion function.

Fixes: f08fcced ("crypto: allwinner - Add sun8i-ss cryptographic offloader")
Signed-off-by: NCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6496ac0b
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* You could find a link for the datasheet in Documentation/arm/sunxi.rst * You could find a link for the datasheet in Documentation/arm/sunxi.rst
*/ */
#include <linux/bottom_half.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -271,7 +272,9 @@ static int sun8i_ss_handle_cipher_request(struct crypto_engine *engine, void *ar ...@@ -271,7 +272,9 @@ static int sun8i_ss_handle_cipher_request(struct crypto_engine *engine, void *ar
struct skcipher_request *breq = container_of(areq, struct skcipher_request, base); struct skcipher_request *breq = container_of(areq, struct skcipher_request, base);
err = sun8i_ss_cipher(breq); err = sun8i_ss_cipher(breq);
local_bh_disable();
crypto_finalize_skcipher_request(engine, breq, err); crypto_finalize_skcipher_request(engine, breq, err);
local_bh_enable();
return 0; return 0;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* *
* You could find the datasheet in Documentation/arm/sunxi.rst * You could find the datasheet in Documentation/arm/sunxi.rst
*/ */
#include <linux/bottom_half.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
...@@ -441,6 +442,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq) ...@@ -441,6 +442,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq)
theend: theend:
kfree(pad); kfree(pad);
kfree(result); kfree(result);
local_bh_disable();
crypto_finalize_hash_request(engine, breq, err); crypto_finalize_hash_request(engine, breq, err);
local_bh_enable();
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册