mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
KEYS: trusted: Avoid calling null function trusted_key_exit
[ Upstream commitc5d1ed846e
] 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:5d0682be31
("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>
This commit is contained in:
parent
a6cfab1dc7
commit
8b4c55f4b0
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue