All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] trusted-firmware-a: continue if TPM device is missing
@ 2024-04-17 11:07 Mikko Rapeli
  2024-04-17 11:07 ` [PATCH 2/2] optee-ftpm: enumerate also without tee-supplicant Mikko Rapeli
  2024-04-20 22:40 ` [PATCH 1/2] trusted-firmware-a: continue if TPM device is missing Jon Mason
  0 siblings, 2 replies; 17+ messages in thread
From: Mikko Rapeli @ 2024-04-17 11:07 UTC (permalink / raw)
  To: meta-arm; +Cc: Mikko Rapeli

All other firmware boot components also continue booting
if TPM is not found. It is up to subsequent SW components
to e.g. fail if rootfs can't be decrypted. Enables policies
like fall back to unencrypted rootfs if TPM device is
not found with qemu and swtpm.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 ...ot.c-ignore-TPM-error-and-continue-w.patch | 36 +++++++++++++++++++
 .../trusted-firmware-a_2.10.3.bb              |  5 +++
 2 files changed, 41 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch
new file mode 100644
index 00000000..2d189d8e
--- /dev/null
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch
@@ -0,0 +1,36 @@
+From 1d1425bde8435d6e2b3e4f2b7bcb2eb293ef9601 Mon Sep 17 00:00:00 2001
+From: Mikko Rapeli <mikko.rapeli@linaro.org>
+Date: Mon, 15 Jan 2024 09:26:56 +0000
+Subject: [PATCH] qemu_measured_boot.c: ignore TPM error and continue with boot
+
+If firmware is configured with TPM support but it's missing
+on HW, e.g. swtpm not started and/or configured with qemu,
+then continue booting. Missing TPM is not a fatal error.
+Enables testing boot without TPM device to see that
+missing TPM is detected further up the SW stack and correct
+fallback actions are taken.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
+---
+ plat/qemu/qemu/qemu_measured_boot.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/plat/qemu/qemu/qemu_measured_boot.c b/plat/qemu/qemu/qemu_measured_boot.c
+index 122bb23b14..731b081c47 100644
+--- a/plat/qemu/qemu/qemu_measured_boot.c
++++ b/plat/qemu/qemu/qemu_measured_boot.c
+@@ -79,7 +79,8 @@ void bl2_plat_mboot_finish(void)
+ 		 * Note: In QEMU platform, OP-TEE uses nt_fw_config to get the
+ 		 * secure Event Log buffer address.
+ 		 */
+-		panic();
++		ERROR("Ignoring TPM errors, continuing without\n");
++		return;
+ 	}
+ 
+ 	/* Copy Event Log to Non-secure memory */
+-- 
+2.34.1
+
diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.3.bb
index b30ac725..13942dbb 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.3.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.3.bb
@@ -11,3 +11,8 @@ SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=ht
 SRCREV_mbedtls = "72718dd87e087215ce9155a826ee5a66cfbe9631"
 
 LIC_FILES_CHKSUM_MBEDTLS = "file://mbedtls/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+# continue to boot also without TPM
+SRC_URI += "\
+    file://0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch \
+"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH v2 0/6] TPM and fTPM test
@ 2024-04-30 12:37 Mikko Rapeli
  2024-04-30 12:37 ` [PATCH 1/6] trusted-firmware-a: continue if TPM device is missing Mikko Rapeli
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Mikko Rapeli @ 2024-04-30 12:37 UTC (permalink / raw)
  To: meta-arm; +Cc: Mikko Rapeli

v1: https://lists.yoctoproject.org/g/meta-arm/topic/105574754

v2: Dropped "optee-ftpm: enumerate also without tee-supplicant" since it
    depends on not-yet-merged kernel and optee patches. Added optee and
    ftpm tests which now pass on qemuarm-secureboot and
    qemuarm64-secureboot machines.

Mikko Rapeli (6):
  trusted-firmware-a: continue if TPM device is missing
  optee-os: inrease heap size with fTPM
  oeqa runtime: add optee.py test
  oeqa runtime: add ftpm.py test
  ci/qemuarm64-secureboot.yml: install optee and test both optee and
    ftpm
  ci/qemuarm-secureboot.yml: install optee and test both optee and ftpm

 ci/qemuarm-secureboot.yml                     |  8 ++--
 ci/qemuarm64-secureboot.yml                   |  8 ++--
 meta-arm/lib/oeqa/runtime/cases/ftpm.py       | 41 +++++++++++++++++++
 meta-arm/lib/oeqa/runtime/cases/optee.py      | 24 +++++++++++
 ...ot.c-ignore-TPM-error-and-continue-w.patch | 36 ++++++++++++++++
 .../trusted-firmware-a_2.10.3.bb              |  5 +++
 .../optee-ftpm/optee-os_%.bbappend            | 16 +++-----
 7 files changed, 122 insertions(+), 16 deletions(-)
 create mode 100644 meta-arm/lib/oeqa/runtime/cases/ftpm.py
 create mode 100644 meta-arm/lib/oeqa/runtime/cases/optee.py
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-qemu_measured_boot.c-ignore-TPM-error-and-continue-w.patch

-- 
2.34.1



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-05-01  2:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-17 11:07 [PATCH 1/2] trusted-firmware-a: continue if TPM device is missing Mikko Rapeli
2024-04-17 11:07 ` [PATCH 2/2] optee-ftpm: enumerate also without tee-supplicant Mikko Rapeli
2024-04-22  8:02   ` [meta-arm] " Sumit Garg
2024-04-22  8:13     ` Mikko Rapeli
2024-04-30 12:44   ` Mikko Rapeli
2024-04-20 22:40 ` [PATCH 1/2] trusted-firmware-a: continue if TPM device is missing Jon Mason
2024-04-22  7:29   ` Mikko Rapeli
2024-04-23 18:21     ` Jon Mason
2024-04-24  6:37       ` Mikko Rapeli
  -- strict thread matches above, loose matches on Subject: below --
2024-04-30 12:37 [PATCH v2 0/6] TPM and fTPM test Mikko Rapeli
2024-04-30 12:37 ` [PATCH 1/6] trusted-firmware-a: continue if TPM device is missing Mikko Rapeli
2024-04-30 12:37 ` [PATCH 2/6] optee-os: inrease heap size with fTPM Mikko Rapeli
2024-04-30 12:37 ` [PATCH 3/6] oeqa runtime: add optee.py test Mikko Rapeli
2024-04-30 12:37 ` [PATCH 4/6] oeqa runtime: add ftpm.py test Mikko Rapeli
2024-04-30 12:37 ` [PATCH 5/6] ci/qemuarm64-secureboot.yml: install optee and test both optee and ftpm Mikko Rapeli
2024-04-30 12:37 ` [PATCH 6/6] ci/qemuarm-secureboot.yml: " Mikko Rapeli
2024-05-01  2:06 ` [PATCH v2 0/6] TPM and fTPM test Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.