]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: tegra - Disable softirqs before finalizing request
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 10 Mar 2026 09:28:29 +0000 (18:28 +0900)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 22 Mar 2026 02:17:58 +0000 (11:17 +0900)
Softirqs must be disabled when calling the finalization fucntion on
a request.

Reported-by: Guangwu Zhang <guazhang@redhat.com>
Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/tegra/tegra-se-aes.c
drivers/crypto/tegra/tegra-se-hash.c

index 0e07d0523291a59a86793ed9d575353147084da4..8b91f00b9c31dd5eac8f38cde1eddd78fce0706a 100644 (file)
@@ -4,6 +4,7 @@
  * Crypto driver to handle block cipher algorithms using NVIDIA Security Engine.
  */
 
+#include <linux/bottom_half.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
@@ -333,7 +334,9 @@ out:
                tegra_key_invalidate_reserved(ctx->se, key2_id, ctx->alg);
 
 out_finalize:
+       local_bh_disable();
        crypto_finalize_skcipher_request(se->engine, req, ret);
+       local_bh_enable();
 
        return 0;
 }
@@ -1261,7 +1264,9 @@ out_free_inbuf:
                tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg);
 
 out_finalize:
+       local_bh_disable();
        crypto_finalize_aead_request(ctx->se->engine, req, ret);
+       local_bh_enable();
 
        return 0;
 }
@@ -1347,7 +1352,9 @@ out_free_inbuf:
                tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg);
 
 out_finalize:
+       local_bh_disable();
        crypto_finalize_aead_request(ctx->se->engine, req, ret);
+       local_bh_enable();
 
        return 0;
 }
@@ -1745,7 +1752,9 @@ out:
        if (tegra_key_is_reserved(rctx->key_id))
                tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg);
 
+       local_bh_disable();
        crypto_finalize_hash_request(se->engine, req, ret);
+       local_bh_enable();
 
        return 0;
 }
index 4a298ace6e9f79489e6fe715dda49de40475c95d..79f1e5c9b729cc82539f00a6b25faa9b8c2a668f 100644 (file)
@@ -4,6 +4,7 @@
  * Crypto driver to handle HASH algorithms using NVIDIA Security Engine.
  */
 
+#include <linux/bottom_half.h>
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
@@ -546,7 +547,9 @@ static int tegra_sha_do_one_req(struct crypto_engine *engine, void *areq)
        }
 
 out:
+       local_bh_disable();
        crypto_finalize_hash_request(se->engine, req, ret);
+       local_bh_enable();
 
        return 0;
 }