summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDave Kleikamp <dave.kleikamp@oracle.com>2022-01-26 14:32:43 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 13:57:37 +0200
commit8b4c55f4b079987d4fd6dc1c8b8ff9c0bd647e29 (patch)
treee5accf08251a894b98b0934efe2e4a6398adb94b /security
parenta6cfab1dc7e1f1303da77edccb799eec49671c0a (diff)
downloadlinux-rt-8b4c55f4b079987d4fd6dc1c8b8ff9c0bd647e29.tar.gz
KEYS: trusted: Avoid calling null function trusted_key_exit
[ Upstream commit c5d1ed846e15090bc90dfdaafc07eac066e070bb ] If one loads and unloads the trusted module, trusted_key_exit can be NULL. Call it through static_call_cond() to avoid a kernel trap. Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com> Cc: Sumit Garg <sumit.garg@linaro.org> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jarkko Sakkinen <jarkko@kernel.org> Cc: Mimi Zohar <zohar@linux.ibm.com> Cc: David Howells <dhowells@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: "Serge E. Hallyn" <serge@hallyn.com> Cc: linux-integrity@vger.kernel.org Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/trusted-keys/trusted_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c
index 5b35f1b87644..9b9d3ef79cbe 100644
--- a/security/keys/trusted-keys/trusted_core.c
+++ b/security/keys/trusted-keys/trusted_core.c
@@ -351,7 +351,7 @@ static int __init init_trusted(void)
static void __exit cleanup_trusted(void)
{
- static_call(trusted_key_exit)();
+ static_call_cond(trusted_key_exit)();
}
late_initcall(init_trusted);