]> www.infradead.org Git - users/dwmw2/linux.git/commit
KEYS: trusted: Fix trusted key backends when building as module
authorAndreas Rammhold <andreas@rammhold.de>
Wed, 1 Dec 2021 09:59:00 +0000 (10:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:37 +0000 (13:57 +0200)
commita6cfab1dc7e1f1303da77edccb799eec49671c0a
treeaf9d058b0e83b0b716eaff559a064974f16c3b61
parent7aecbac9efa44549c2c79cc92c7a37b3e9c75302
KEYS: trusted: Fix trusted key backends when building as module

[ Upstream commit 969a26446bcd142faedfe8c6f41cd7668596c1fa ]

Before this commit the kernel could end up with no trusted key sources
even though both of the currently supported backends (TPM and TEE) were
compiled as modules. This manifested in the trusted key type not being
registered at all.

When checking if a CONFIG_… preprocessor variable is defined we only
test for the builtin (=y) case and not the module (=m) case. By using
the IS_REACHABLE() macro we do test for both cases.

Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework")
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/keys/trusted-keys/trusted_core.c