summaryrefslogtreecommitdiff
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2019-07-02 14:39:20 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-07-26 14:51:57 +1000
commit69017f14631c4376c8a372a026d77b4f11876fbc (patch)
tree20f6cc64ad624098a8363687e0fc2cd6183ca42b /crypto/testmgr.c
parent0a4fa7ef65b9f8d2d8cd0db31769f3a0eb77e76f (diff)
downloadlinux-crypto-69017f14631c4376c8a372a026d77b4f11876fbc.tar.gz
linux-crypto-69017f14631c4376c8a372a026d77b4f11876fbc.zip
crypto: fips - add FIPS test failure notification chain
Crypto test failures in FIPS mode cause an immediate panic, but on some system the cryptographic boundary extends beyond just the Linux controlled domain. Add a simple atomic notification chain to allow interested parties to register to receive notification prior to us kicking the bucket. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/testmgr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index d0b5b338..8ba1e75c 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -5240,9 +5240,11 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
type, mask);
test_done:
- if (rc && (fips_enabled || panic_on_fail))
+ if (rc && (fips_enabled || panic_on_fail)) {
+ fips_fail_notify();
panic("alg: self-tests for %s (%s) failed in %s mode!\n",
driver, alg, fips_enabled ? "fips" : "panic_on_fail");
+ }
if (fips_enabled && !rc)
pr_info("alg: self-tests for %s (%s) passed\n", driver, alg);