]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KEYS: trusted: Remove redundant static calls usage
authorSumit Garg <sumit.garg@linaro.org>
Fri, 6 Oct 2023 05:18:01 +0000 (10:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:05:33 +0000 (23:05 +0200)
commitafe5f596b58838a041436c02ab221325925b78d2
tree65fc34b3d59590294e26cdd82f337773eb40efbe
parent20e73ece06b3368a45e29b7671acb283f3de583f
KEYS: trusted: Remove redundant static calls usage

[ Upstream commit 01bbafc63b65689cb179ca537971286bc27f3b74 ]

Static calls invocations aren't well supported from module __init and
__exit functions. Especially the static call from cleanup_trusted() led
to a crash on x86 kernel with CONFIG_DEBUG_VIRTUAL=y.

However, the usage of static call invocations for trusted_key_init()
and trusted_key_exit() don't add any value from either a performance or
security perspective. Hence switch to use indirect function calls instead.

Note here that although it will fix the current crash report, ultimately
the static call infrastructure should be fixed to either support its
future usage from module __init and __exit functions or not.

Reported-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Link: https://lore.kernel.org/lkml/ZRhKq6e5nF%2F4ZIV1@fedora/#t
Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework")
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/keys/trusted-keys/trusted_core.c