]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: trusted: Avoid calling null function trusted_key_exit
authorDave Kleikamp <dave.kleikamp@oracle.com>
Wed, 26 Jan 2022 20:32:43 +0000 (14:32 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:09 +0000 (14:23 +0200)
commit8a27750f6131e63a5254b574e5355487059fdd5d
treebbb24be154f6c809c395634ac7d12d5de7392e0c
parent4b8d69aa249ef7f3353688bd5171a9c69fd30541
KEYS: trusted: Avoid calling null function trusted_key_exit

[ Upstream commit 98fe24831c96dc9387e8a49ca5ddc9956de376a5 ]

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: 2eb67b35451e ("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>
security/keys/trusted-keys/trusted_core.c