diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-02-15 08:57:51 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-02-22 15:56:03 +0800 |
commit | ee509efc74ddbc59bb5d6fd6e050f9ef25f74bff (patch) | |
tree | de05489658090b356f4c4c7d4bd0b06e661f5294 | |
parent | 5ab6c06dff298ecf2afb64975dc66761c261d944 (diff) |
crypto: skcipher - Zap type in crypto_alloc_sync_skcipher
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>
-rw-r--r-- | crypto/skcipher.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c index e3751cc88b76..cdf0f11c7eaa 100644 --- a/crypto/skcipher.c +++ b/crypto/skcipher.c @@ -682,6 +682,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); |