]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: skcipher - Zap type in crypto_alloc_sync_skcipher
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 15 Feb 2025 00:57:51 +0000 (08:57 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 22 Feb 2025 07:56:03 +0000 (15:56 +0800)
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>
crypto/skcipher.c

index e3751cc88b76edb9033478799616127d4f3a2daf..cdf0f11c7eaa3d772bc2dbbcac09c99324a7dc07 100644 (file)
@@ -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);