summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2021-07-22 01:39:54 +0300
committerMichael Bestas <mkbestas@lineageos.org>2021-07-22 01:39:54 +0300
commit954d3318ebc1b79dc469995450b23c30ce44b6af (patch)
tree50ba2449476562b2aa8e2f6bd55e5f4915958163 /crypto
parent3c741a8b469c522434e6841d8618702303fd6a21 (diff)
parente5239ed489f6471bc235af8534ee57d1923778e4 (diff)
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-msm8998
This brings LA.UM.9.2.r1-03400-SDMxx0.0 up to date with https://android.googlesource.com/kernel/common/ android-4.4-p at commit: e5239ed489f64 Merge 4.4.276 into android-4.4-p Change-Id: I5f3fdc31e61b229b299cf72014710d36e42863d8
Diffstat (limited to 'crypto')
-rw-r--r--crypto/shash.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/crypto/shash.c b/crypto/shash.c
index b086b0174b82..4490269eafc3 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -24,12 +24,24 @@
static const struct crypto_type crypto_shash_type;
-int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
- unsigned int keylen)
+static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
+ unsigned int keylen)
{
return -ENOSYS;
}
-EXPORT_SYMBOL_GPL(shash_no_setkey);
+
+/*
+ * Check whether an shash algorithm has a setkey function.
+ *
+ * For CFI compatibility, this must not be an inline function. This is because
+ * when CFI is enabled, modules won't get the same address for shash_no_setkey
+ * (if it were exported, which inlining would require) as the core kernel will.
+ */
+bool crypto_shash_alg_has_setkey(struct shash_alg *alg)
+{
+ return alg->setkey != shash_no_setkey;
+}
+EXPORT_SYMBOL_GPL(crypto_shash_alg_has_setkey);
static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key,
unsigned int keylen)