Skip to content
Permalink
Browse files
fTPM: make sure TEE is initialized before fTPM
For built-in drivers, the order of initialization function invocation is
determined by their link order.

The original code linked TPM drivers before TEE driver when they were
both built in. That caused fTPM's initialization to be deferred to a
worker thread instead of running on PID 1.

That is problematic because IMA's initialization routine, which runs on
PID 1 as a late initcall, needs to have access to the default TPM
instance. If fTPM's initialization is deferred, IMA will not be able to
get hold of a TPM instance in time.

Fix this by modifying Makefile to make sure TEE is initialized before
fTPM when they are both built in.

Signed-off-by: Wei Liu <wei.liu@kernel.org>
  • Loading branch information
liuw authored and intel-lab-lkp committed Jan 16, 2021
1 parent 5ee8805 commit b82b3e643532e299d9c6e622604e6d8d090153f0
Showing 1 changed file with 5 additions and 0 deletions.
@@ -180,6 +180,11 @@ obj-$(CONFIG_NVMEM) += nvmem/
obj-$(CONFIG_FPGA) += fpga/
obj-$(CONFIG_FSI) += fsi/
obj-$(CONFIG_TEE) += tee/

# TPM drivers must come after TEE, otherwise fTPM initialization will be
# deferred, which causes IMA to not get a TPM device in time
obj-$(CONFIG_TCG_TPM) += char/tpm/

obj-$(CONFIG_MULTIPLEXER) += mux/
obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/
obj-$(CONFIG_SIOX) += siox/

0 comments on commit b82b3e6

Please sign in to comment.