aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/api.c2
-rw-r--r--include/linux/crypto.h5
-rw-r--r--security/integrity/evm/evm_crypto.c3
3 files changed, 8 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 0ee632bba064..7aca9f86c5f3 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -229,7 +229,7 @@ static struct crypto_alg *crypto_larval_lookup(const char *name, u32 type,
229 mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); 229 mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
230 230
231 alg = crypto_alg_lookup(name, type, mask); 231 alg = crypto_alg_lookup(name, type, mask);
232 if (!alg) { 232 if (!alg && !(mask & CRYPTO_NOLOAD)) {
233 request_module("crypto-%s", name); 233 request_module("crypto-%s", name);
234 234
235 if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask & 235 if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 6eb06101089f..e8839d3a7559 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -113,6 +113,11 @@
113#define CRYPTO_ALG_OPTIONAL_KEY 0x00004000 113#define CRYPTO_ALG_OPTIONAL_KEY 0x00004000
114 114
115/* 115/*
116 * Don't trigger module loading
117 */
118#define CRYPTO_NOLOAD 0x00008000
119
120/*
116 * Transform masks and values (for crt_flags). 121 * Transform masks and values (for crt_flags).
117 */ 122 */
118#define CRYPTO_TFM_NEED_KEY 0x00000001 123#define CRYPTO_TFM_NEED_KEY 0x00000001
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index b60524310855..c20e3142b541 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -97,7 +97,8 @@ static struct shash_desc *init_desc(char type)
97 mutex_lock(&mutex); 97 mutex_lock(&mutex);
98 if (*tfm) 98 if (*tfm)
99 goto out; 99 goto out;
100 *tfm = crypto_alloc_shash(algo, 0, CRYPTO_ALG_ASYNC); 100 *tfm = crypto_alloc_shash(algo, 0,
101 CRYPTO_ALG_ASYNC | CRYPTO_NOLOAD);
101 if (IS_ERR(*tfm)) { 102 if (IS_ERR(*tfm)) {
102 rc = PTR_ERR(*tfm); 103 rc = PTR_ERR(*tfm);
103 pr_err("Can not allocate %s (reason: %ld)\n", algo, rc); 104 pr_err("Can not allocate %s (reason: %ld)\n", algo, rc);