]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:38:03 +0000 (14:38 +0200)
commitb6e395e6f6a15666a5f75aef936a99c0fce29d97
tree1eff80cd4c3719dd3b97164ba059440cddd32a09
parent56876980ce648717dc31feb77d3474679d6ff6ec
KEYS: trusted: Avoid calling null function trusted_key_exit

BugLink: https://bugs.launchpad.net/bugs/1969110
[ 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>
(cherry picked from commit bfa4a733aeaab29983cb553b60e09ac8d774d6d4)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
security/keys/trusted-keys/trusted_core.c