summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-02-15 08:57:51 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-29 11:02:40 +0200
commit897c98fb328011461cc63ea1533688bdac035ad8 (patch)
treef49493818ccc533a28364d8363838d1c809413e7
parent9f27b38771b05067f5fadf4628296efb768e50d4 (diff)
crypto: skcipher - Zap type in crypto_alloc_sync_skcipher
[ Upstream commit ee509efc74ddbc59bb5d6fd6e050f9ef25f74bff ] The type needs to be zeroed as otherwise the user could use it to allocate an asynchronous sync skcipher. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--crypto/skcipher.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index ceed7f33a67b..fd3273b519dc 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -844,6 +844,7 @@ struct crypto_sync_skcipher *crypto_alloc_sync_skcipher(
/* Only sync algorithms allowed. */
mask |= CRYPTO_ALG_ASYNC | CRYPTO_ALG_SKCIPHER_REQSIZE_LARGE;
+ type &= ~(CRYPTO_ALG_ASYNC | CRYPTO_ALG_SKCIPHER_REQSIZE_LARGE);
tfm = crypto_alloc_tfm(alg_name, &crypto_skcipher_type, type, mask);