summaryrefslogtreecommitdiff
path: root/crypto/skcipher.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-07-09 23:20:39 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2020-07-16 21:49:08 +1000
commitb1ab682ba843fb0f99cb66969432c55bf8aa35b4 (patch)
tree27934b74da3b079cd13216bf35e7b76f1f0b2102 /crypto/skcipher.c
parent558cc15c0d3341a2aa80a2e0be1e2e8307efebee (diff)
downloadlinux-crypto-b1ab682ba843fb0f99cb66969432c55bf8aa35b4.tar.gz
linux-crypto-b1ab682ba843fb0f99cb66969432c55bf8aa35b4.zip
crypto: algapi - add NEED_FALLBACK to INHERITED_FLAGS
CRYPTO_ALG_NEED_FALLBACK is handled inconsistently. When it's requested to be clear, some templates propagate that request to child algorithms, while others don't. It's apparently desired for NEED_FALLBACK to be propagated, to avoid deadlocks where a module tries to load itself while it's being initialized, and to avoid unnecessarily complex fallback chains where we have e.g. cbc-aes-$driver falling back to cbc(aes-$driver) where aes-$driver itself falls back to aes-generic, instead of cbc-aes-$driver simply falling back to cbc(aes-generic). There have been a number of fixes to this effect: commit 4e20b8b65210 ("crypto: xts - Propagate NEED_FALLBACK bit") commit 25fe465280e3 ("crypto: ctr - Propagate NEED_FALLBACK bit") commit cf197f2b42c6 ("crypto: cbc - Propagate NEED_FALLBACK bit") But it seems that other templates can have the same problems too. To avoid this whack-a-mole, just add NEED_FALLBACK to INHERITED_FLAGS so that it's always inherited. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/skcipher.c')
-rw-r--r--crypto/skcipher.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index 3b93a74a..467af525 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -943,8 +943,6 @@ struct skcipher_instance *skcipher_alloc_instance_simple(
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SKCIPHER, &mask);
if (err)
return ERR_PTR(err);
- mask |= crypto_requires_off(crypto_get_attr_type(tb),
- CRYPTO_ALG_NEED_FALLBACK);
inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL);
if (!inst)