From 82d8a42ed67722992904eb19ffde20b2d384b87f Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Wed, 15 Jan 2025 09:38:57 +0100 Subject: [PATCH] core: pta: device: fix enumeration for PTA_CMD_GET_DEVICES_SUPP TAs which depend on TEE_STORAGE_PRIVATE do need the TEE supplicant if REE FS is disabled (in which case secure storage can only be RPMB) and RPMB is not routed via the kernel. Fixes: a96033ca7bee ("core: add flag to enumerate TAs when secure storage is ready") Signed-off-by: Jerome Forissier Acked-by: Etienne Carriere Acked-by: Jens Wiklander --- core/pta/device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/pta/device.c b/core/pta/device.c index 279d49026ea..39ad3ddda19 100644 --- a/core/pta/device.c +++ b/core/pta/device.c @@ -88,6 +88,11 @@ static TEE_Result invoke_command(void *pSessionContext __unused, { TEE_Result res = TEE_SUCCESS; uint32_t rflags = 0; + /* + * This should also be true if CFG_RPMB_ANNOUNCE_PROBE_CAP is + * enabled when the kernel does not support OP-TEE RPMB operations. + */ + bool rpmb_needs_supp = !IS_ENABLED(CFG_RPMB_ANNOUNCE_PROBE_CAP); switch (nCommandID) { case PTA_CMD_GET_DEVICES: @@ -95,7 +100,8 @@ static TEE_Result invoke_command(void *pSessionContext __unused, break; case PTA_CMD_GET_DEVICES_SUPP: rflags = TA_FLAG_DEVICE_ENUM_SUPP; - if (IS_ENABLED(CFG_REE_FS)) + if (IS_ENABLED(CFG_REE_FS) || + (IS_ENABLED(CFG_RPMB_FS) && rpmb_needs_supp)) rflags |= TA_FLAG_DEVICE_ENUM_TEE_STORAGE_PRIVATE; break; case PTA_CMD_GET_DEVICES_RPMB: