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.
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(a)lists.trustedfirmware.org<mailto: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:~:t…
Hi All,
I want to generate a rsa key pair with 4096 bits.
Using below mbedTLS api , inside my TEE server side implementation.
ret = mbedtls_rsa_gen_key( mbedtls_pk_rsa( key ), mbedtls_ctr_drbg_random,
&ctr_drbg, 4096, 65537 );
This is resulting in the below error.
mempool_alloc:197Failed to allocate 288 bytes, please tune the pool
size failed
Mines is arm64 infrastructure, with kernel 4.19.183 and optee_os 3.7.0
We tried doing below change (courtesy:
https://github.com/OP-TEE/optee_os/issues/3328) and recompiling tomcrypt
library
In core/lib/libtomcrypt/mpi_desc.c, we changed MPI_MEMPOOL_SIZE
#define MPI_MEMPOOL_SIZE (42 * 1024)
to #define MPI_MEMPOOL_SIZE (82 * 1024)
This didn’t help, kindly provide your inputs.
Thanks
Hi,
(in context of testing BTI support when OP-TEE is loaded as a secure partition on top of SEL2/Hafnium)
I read through the OP-TEE documentation, and would like to confirm:
CFG_CORE_BTI=y seems mandatorily required to support BTI in TAs. It means we cannot enable independently BTI for TAs and 'disable' for TEE core, is this correct?
Interestingly I noticed I can build with CFG_CORE_BTI=n and CTG_TA_BTI=y but I appreciate the end result is that the TA get BTI landpads but is not effectively leveraging the arch extension because code page aren't guarde if TEE core option isn't enabled.
I was investigating a way to omit building a specific toolchain as it appears to be required when CFG_CORE_BTI=y, but I'll go ahead if there's no way round.
Out of curiosity is OP-TEE core pulling gcc libraries? And if yes, which kind? I naively thought OP-TEE core would be freestanding or be independent from toolchain libs.
Thanks & Regards,
Olivier.
Hi All,
This is a follow-up email to the OP-TEE 3.18 release, highlighting the
updates to the SPMC and related components.
Short summary of introduced changes:
- optee_os: Added support to the SPMC to process memory regions
described in the SP manifest. This enables running the
Trusted Services smm-gateway SP.
- manifest: Added new manifest (derived from the fvp manifest) which
includes Trusted Services and related kernel modules [1].
- build: Added new top level Makefile to configure optee_os as
S-EL1 SPMC, build Trusted Services SPs and test apps [2].
For more details on how to get, build and test the SPMC, please see [3].
Regards,
Balint
[1]: https://github.com/OP-TEE/manifest/blob/3.18.0/fvp-ts.xml
[2]: https://github.com/OP-TEE/build/blob/3.18.0/fvp-psa-sp.mk
[3]: https://developer.trustedfirmware.org/w/trusted-services/op-tee-spmc
Hello arm-soc maintainers,
Please pull these small fixes in the TEE subssytem. The OP-TEE driver
patch fixes an error which was introduced during the merge window. I'm
not sure if the error really can be triggered, but it would be nice to
have it fixed before the release.
Thanks,
Jens
The following changes since commit b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3:
Linux 5.19-rc2 (2022-06-12 16:11:37 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git/ tags/tee-fixes-for-v5.19
for you to fetch changes up to e5ce073c8a1e01b215a5eb32ba48f8d17ded3bd5:
tee: tee_get_drvdata(): fix description of return value (2022-07-08 10:51:24 +0200)
----------------------------------------------------------------
Fixes for TEE subsystem
A fix for the recently merged commit ed8faf6c8f8c ("optee: add
OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG").
Two small fixes in comment, repeated words etc.
----------------------------------------------------------------
Jiang Jian (1):
optee: Remove duplicate 'of' in two places.
Marc Kleine-Budde (1):
tee: tee_get_drvdata(): fix description of return value
Yang Yingliang (1):
optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR()
drivers/tee/optee/optee_smc.h | 2 +-
drivers/tee/optee/smc_abi.c | 4 ++--
drivers/tee/tee_core.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
[BCC all OP-TEE maintainers]
Hi OP-TEE maintainers & contributors,
OP-TEE v3.17.0 is scheduled to be released on 2022-07-15. So, now is a
good time to start testing the master branch on the various platforms
and report/fix any bugs.
The GitHub pull request for collecting Tested-by tags or any other
comments is https://github.com/OP-TEE/optee_os/pull/5395
As usual, we will create a release candidate tag one week before the
release date for final testing.
In addition to that you can find some additional information related
to releases here:
https://optee.readthedocs.io/en/latest/general/releases.html
Thanks,
Jens
Hello arm-soc maintainers,
Please pull this small patch which fixes a compiler warning in the OP-TEE
driver.
Note that this pull request is on top of and earlier accepted/applied [1]
pull request in order to avoid a merge conflict.
Thanks,
Jens
[1] https://lore.kernel.org/lkml/20220503192916.GA3288817@jade/
The following changes since commit 3e47235eaee09488c7e467b9aaccb7c93c862c6b:
tee: make tee_shm_register_kernel_buf vmalloc supported (2022-04-05 08:04:16 +0200)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git/ tags/optee-warning-for-v5.19
for you to fetch changes up to a3b9ecc805e9131476c719111fe347c7dbc0d1d1:
tee: optee: Pass a pointer to virt_addr_valid() (2022-05-30 08:06:45 +0200)
----------------------------------------------------------------
Fix a compiler warning in OP-TEE driver
----------------------------------------------------------------
Linus Walleij (1):
tee: optee: Pass a pointer to virt_addr_valid()
drivers/tee/optee/call.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
A pointer into virtual memory is represented by a (void *)
not an u32, so the compiler warns:
drivers/tee/optee/call.c:365:29: warning: passing argument 1
of 'virt_to_pfn' makes pointer from integer without a
cast [-Wint-conversion]
Fix this with an explicit cast.
Cc: Sumit Garg <sumit.garg(a)linaro.org>
Signed-off-by: Linus Walleij <linus.walleij(a)linaro.org>
---
drivers/tee/optee/call.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index bd49ec934060..51275d77ec84 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -362,7 +362,7 @@ int optee_check_mem_type(unsigned long start, size_t num_pages)
* Allow kernel address to register with OP-TEE as kernel
* pages are configured as normal memory only.
*/
- if (virt_addr_valid(start))
+ if (virt_addr_valid((void *)start))
return 0;
mmap_read_lock(mm);
--
2.35.1
Hello arm-soc maintainers,
Please pull these small cleanup patches which removes two unused and
outdated TEE_IOCTL_SHM_* flags and two unused pa2va and va2pa functions for
tee_shm's.
Thanks,
Jens
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/tee-cleanup-for-v5.19
for you to fetch changes up to d8fc1c7c4c9b705ce5f5bba772ad66a0137c685d:
tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF (2022-04-26 10:17:03 +0200)
----------------------------------------------------------------
TEE cleanup
Removes the old and unused TEE_IOCTL_SHM_* flags
Removes unused the unused tee_shm_va2pa() and tee_shm_pa2va() functions
----------------------------------------------------------------
Andrew Davis (2):
tee: remove tee_shm_va2pa() and tee_shm_pa2va()
tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF
drivers/tee/tee_core.c | 2 --
drivers/tee/tee_shm.c | 50 ------------------------------------------------
include/linux/tee_drv.h | 18 -----------------
include/uapi/linux/tee.h | 4 ----
4 files changed, 74 deletions(-)
Hi all,
This patchset optimizes handling of the argument struct passed to
call_with_arg when doing a yielding call to OP-TEE.
Prior to this was this struct allocated before the yielding call and
then freed after it had returned. In case many calls are made in succession
this results in quite a bit of unnecessary allocte/free and possibly also
switching back and forth to secure work in order to register if needed.
Another optimization handles the way the argument struct needed to do RPC
is passed. Please see the patch "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG" for details.
Thanks,
Jens
v1->v2:
* Split out a separate commit "optee: rename rpc_arg_count to
rpc_param_count"
* Check optee->rpc_param_count before calling optee_disable_shm_cache().
* Mention OPTEE_SMC_CALL_WITH_REGD_ARG in commit message.
v2->v3:
* Applied Sumit's R-B to "optee: rename rpc_arg_count to rpc_param_count"
and "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG"
* Fixed some review comments to "optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG"
* Rebased on v5.18-rc1
v3->v4:
* Updated "optee: cache argument shared memory structs" to work with older
versions of the SMC-ABI when using dynamic shared memory.
Jens Wiklander (4):
optee: rename rpc_arg_count to rpc_param_count
optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and
OPTEE_SMC_CALL_WITH_REGD_ARG
optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET
optee: cache argument shared memory structs
drivers/tee/optee/call.c | 238 ++++++++++++++++++++++++------
drivers/tee/optee/core.c | 1 +
drivers/tee/optee/ffa_abi.c | 36 +++--
drivers/tee/optee/optee_ffa.h | 12 +-
drivers/tee/optee/optee_private.h | 31 +++-
drivers/tee/optee/optee_smc.h | 48 +++++-
drivers/tee/optee/smc_abi.c | 197 ++++++++++++++++++++-----
7 files changed, 461 insertions(+), 102 deletions(-)
--
2.31.1
Hello arm-soc maintainers,
Please pull these patches which improves performance when communicating
with OP-TEE in the secure world. A cache of argument structs is
implemented to minimize the number of alloc/free and possibly also
register/unregister of these buffers in the secure world. This boosts
the performance in particular in a FF-A configuration. It should also
save a bit of shared memory since each multiple a physical page now can
hold multiple argument structs, instead of one page per struct as it was
before.
The OP-TEE SMC ABI is also extended to pass an argument struct needed
for RPC together with the primary argument struct, in a manner similar
the OP-TEE FF-A ABI.
Thanks,
Jens
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/optee-rpc-arg-for-v5.19
for you to fetch changes up to 5b4018b959149eb5b5f3004fc0339674af67516b:
optee: cache argument shared memory structs (2022-04-25 21:13:05 +0200)
----------------------------------------------------------------
OP-TEE RPC argument cache
Adds caching of the OP-TEE argument structure used to pass request to
secure world. This reduces quite a bit of unnecessary alloc/free and
possibly switching back and forth to secure work in order to register
the buffers in some configurations, most notably FF-A.
----------------------------------------------------------------
Jens Wiklander (4):
optee: rename rpc_arg_count to rpc_param_count
optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG
optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET
optee: cache argument shared memory structs
drivers/tee/optee/call.c | 238 +++++++++++++++++++++++++++++++-------
drivers/tee/optee/core.c | 1 +
drivers/tee/optee/ffa_abi.c | 36 ++++--
drivers/tee/optee/optee_ffa.h | 12 +-
drivers/tee/optee/optee_private.h | 31 ++++-
drivers/tee/optee/optee_smc.h | 48 +++++++-
drivers/tee/optee/smc_abi.c | 197 +++++++++++++++++++++++++------
7 files changed, 461 insertions(+), 102 deletions(-)
Hi ARM SoC Team,
Please pull !
Regards,
Sudeep
-->8
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git tags/ffa-updates-5.19
for you to fetch changes up to f3f3bdbd58cea4fdd088075fdc8864fc47ecd419:
tee: optee: Use ffa_dev_get_drvdata to fetch driver_data (2022-04-29 14:51:46 +0100)
----------------------------------------------------------------
Arm FF-A firmware driver updates/fixes for v5.19
Couple of fixes to handle fragmented memory descriptors and incorrect
UUID parameter passed to ffa_partition_probe. Another fix deals with
the incorrect use of ffa_device's driver_data by the core driver.
Apart from these fixes, there is an addition of ffa_dev_get_drvdata helper
function and its use in optee driver.
----------------------------------------------------------------
Marc Bonnici (1):
firmware: arm_ffa: Fix handling of fragmented memory descriptors
Sudeep Holla (4):
firmware: arm_ffa: Fix uuid parameter to ffa_partition_probe
firmware: arm_ffa: Remove incorrect assignment of driver_data
firmware: arm_ffa: Add ffa_dev_get_drvdata helper function
tee: optee: Use ffa_dev_get_drvdata to fetch driver_data
drivers/firmware/arm_ffa/driver.c | 24 ++++++++++++++----------
drivers/tee/optee/ffa_abi.c | 2 +-
include/linux/arm_ffa.h | 7 ++++++-
3 files changed, 21 insertions(+), 12 deletions(-)
Hello arm-soc maintainers,
Please pull this patch which enables tee_shm_register_kernel_buf() to
accept vmalloc()ed buffers.
Thanks,
Jens
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/tee-shm-vmalloc-for-v5.19
for you to fetch changes up to 3e47235eaee09488c7e467b9aaccb7c93c862c6b:
tee: make tee_shm_register_kernel_buf vmalloc supported (2022-04-05 08:04:16 +0200)
----------------------------------------------------------------
TEE accept vmalloc()ed buffers for tee_shm_register_kernel_buf()
----------------------------------------------------------------
Phil Chang (1):
tee: make tee_shm_register_kernel_buf vmalloc supported
drivers/tee/optee/call.c | 2 +-
drivers/tee/tee_shm.c | 35 +++++++++++++++++++++++++----------
2 files changed, 26 insertions(+), 11 deletions(-)
Hello arm-soc maintainers,
Please pull this small patch which combines the config and menu for TEE's
menuconfig into one line.
Thanks,
Jens
The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:
Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/tee-menu-for-v5.19
for you to fetch changes up to a4b75fe8e1c15c96c4eb083e211ccbbfd56599f9:
tee: combine "config" and "menu" for TEE's menuconfig (2022-04-05 07:32:23 +0200)
----------------------------------------------------------------
Combine TEE config and menu in one line
----------------------------------------------------------------
Jan Engelhardt (1):
tee: combine "config" and "menu" for TEE's menuconfig
drivers/tee/Kconfig | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
While we pass uuid_null intentionally to ffa_partition_probe in
ffa_setup_partitions to get the count of the partitions, it must not be
uuid_null in ffa_partition_info_get which is used by the ffa_drivers
to fetch the specific partition info passing the UUID of the partition.
Fix ffa_partition_info_get by passing the received uuid down to
ffa_partition_probe so that the correct partition information is fetched.
Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions")
Reported-by: Arunachalam Ganapathy <arunachalam.ganapathy(a)arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla(a)arm.com>
---
drivers/firmware/arm_ffa/driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index ccccecae615f..6a913ac91e8e 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -588,7 +588,7 @@ static int ffa_partition_info_get(const char *uuid_str,
return -ENODEV;
}
- count = ffa_partition_probe(&uuid_null, &pbuf);
+ count = ffa_partition_probe(&uuid, &pbuf);
if (count <= 0)
return -ENOENT;
--
2.36.0
Variable rng_size is being initialized with a value that is never read,
the variable is being re-assigned later on. The initialization is
redundant and can be removed.
Cleans up cppcheck warning:
Variable 'rng_size' is assigned a value that is never used.
Signed-off-by: Colin Ian King <colin.i.king(a)gmail.com>
---
drivers/char/hw_random/optee-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index a948c0727b2b..96b5d546d136 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -115,7 +115,7 @@ static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
static int optee_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
{
struct optee_rng_private *pvt_data = to_optee_rng_private(rng);
- size_t read = 0, rng_size = 0;
+ size_t read = 0, rng_size;
int timeout = 1;
u8 *data = buf;
--
2.35.1