Skip to content

RFC Fix IMA + TPM initialisation ordering issue

Jonathan McDowell kvmarm linux-arm-kernel linux-integrity linux-security-module lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 RFC Latest4 patches 7 repliesIn review

Changes in v3 from the cover letter

- Drop ff-a/pKVM diff (this seems to have a separate set of discussion)
- Rework IMA delayed initialisation to avoid delaying when unnecessary
- Ensure IMA log clearly indicates when we've initialised late

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lsm: Allow LSMs to register for late_initcall_sync initinclude/linux/lsm_hooks.h security/lsm_init.c+13 -20 replies
2/4security: ima: call ima_init() again at late_initcall_sync for defered TPMsecurity/integrity/ima/ima.h security/integrity/ima/ima_init.c security/integrity/ima/ima_main.c +1 more+50 -183 replies
3/4Revert "tpm: tpm_crb_ffa: try to probe tpm_crb_ffa when it's built-in"drivers/char/tpm/tpm_crb_ffa.c+3 -161 reply
4/4Revert "firmware: arm_ffa: Change initcall level of ffa_init() to rootfs_initcall"drivers/firmware/arm_ffa/driver.c+1 -13 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchSudeep HollaYeoreum Yun
1/4
2/4R-b
3/4A-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [RFC PATCH v3 0/4] Fix IMA + TPM initialisation ordering issue

This is a slight reworking of the series from Yeoreum Yun, adding functionality for IMA initialisation during the late_initcall_sync stage. This solves the situation where the TPM is not fully registered at the point IMA wants to initialise, avoiding a failure to correctly extend TPM measurements from IMA. This has been observed on both Arm FF-A and SPI attached TPM setups.

As part of this series we also revert the original changes made to the FF-A driver to try and solve this problem.

(I have left Yeoreum credited in all the diffs except my rework of the
IMA piece. Yeoreum, please yell if you're not happy with this.)

Patch history
=============
from v2 to v3:
- Drop ff-a/pKVM diff (this seems to have a separate set of discussion)
- Rework IMA delayed initialisation to avoid delaying when unnecessary
- Ensure IMA log clearly indicates when we've initialised late

from v1 to v2:
- add notifier to make ffa-driver pkvm initialised.
- modify to try initailisation again when IMA coudln't find proper TPM device.
- https://lore.kernel.org/all/[email protected]/#t

Jonathan McDowell (1):
security: ima: call ima_init() again at late_initcall_sync for defered
TPM

Yeoreum Yun (3):
lsm: Allow LSMs to register for late_initcall_sync init Revert "tpm: tpm_crb_ffa: try to probe tpm_crb_ffa when it's built-in" Revert "firmware: arm_ffa: Change initcall level of ffa_init() to
rootfs_initcall"

 drivers/char/tpm/tpm_crb_ffa.c            | 19 ++----------
 drivers/firmware/arm_ffa/driver.c         |  2 +-
 include/linux/lsm_hooks.h                 |  2 ++
 security/integrity/ima/ima.h              |  3 +-
 security/integrity/ima/ima_init.c         | 25 ++++++++-------
 security/integrity/ima/ima_main.c         | 37 ++++++++++++++++++++---
 security/integrity/ima/ima_template_lib.c |  3 +-
 security/lsm_init.c                       | 13 ++++++--
 8 files changed, 67 insertions(+), 37 deletions(-)
Signature · 1 line
2.53.0