Hi Judy,
On Wed, 20 Jul 2022 at 18:29, Judy Wang via OP-TEE op-tee@lists.trustedfirmware.org wrote:
Hi Jens,
As we are developing platforms to enable RPMB secure storage + fTPM TA, we realize that the current design of optee-os relying on a user space daemon tee-supplicant to serve requests cannot meet requirements of another open source linux kernel, IMA(Integrity Measurement Architecture). This module will try to collect data from TPM devices, which in our case, is fTPM TA. It has to collect data when kernel space is booting up, so we cannot delay these requests further until user space is up. With RPMB as our secure storage, some requests will be sent back to kernel space, but tee-supplicant context is not yet initialized, which results in IMA detection of TPM devices failed. Therefore, failed on the measurements we need. I am wondering if we have related discussion on how modify the design to serve optee-os requests during kernel bootup. I can't find related topics in LKML archive.
So the requirement here is to have RPMB accesses routed via the TEE kernel driver itself rather than being dependent on user-mode tee-supplicant. That's a valid use-case and there have been efforts in the past to add a RPMB subsystem within the kernel (the most recent one here [1]). Although for this use-case, I don't think we need that entire RPMB subsystem but some kind of forwarding agent within the TEE kernel driver to read/write encrypted RPMB frames to/from MMC/UFS subsystem.
This has been something on my wish list that I wanted to explore earlier but didn't get enough time. So I would be happy to chip in with reviews/suggestions if you have a proposal/RFC to implement this feature.
[1] https://lore.kernel.org/lkml/20210303135500.24673-1-alex.bennee@linaro.org/
-Sumit
Thank you. Judy.
Cat from /Documentation/ABI/testing/sysfs-bus-optee-devices What: /sys/bus/tee/devices/optee-ta-<uuid>/ Date: May 2020 KernelVersion 5.8 Contact: op-tee@lists.trustedfirmware.orgmailto:op-tee@lists.trustedfirmware.org Description: OP-TEE bus provides reference to registered drivers under this directory. The <uuid> matches Trusted Application (TA) driver and corresponding TA in secure OS. Drivers are free to create needed API under optee-ta-<uuid> directory.
Reference:
fTPM TA: microsoft/MSRSec: Security and Privacy Research at Microsoft (github.com)https://github.com/microsoft/MSRSec IMA enabling: https://sourceforge.net/p/linux-ima/wiki/Home/#enabling-ima-measurement:~:te...