| c2c23cd4 | 14-Oct-2025 |
Etienne Carriere <etienne.carriere@st.com> |
ta: pkcs11: be flexible on RSA private key optional attributes
Allow RSA private key to partially store the RSA private key optional attributes without facing complaints from the GP TEE API.
On one
ta: pkcs11: be flexible on RSA private key optional attributes
Allow RSA private key to partially store the RSA private key optional attributes without facing complaints from the GP TEE API.
On one hand, in the PKCS#11 specification, RSA private key attributes CKA_PRIME_1, CKA_PRIME_2, CKA_EXPONENT_1, CKA_EXPONENT_2 and CKA_COEFFICIENT are optional and the spec does not add much constraints on their presence.
On the other hand, the GP TEE Internal Core API requests that these 5 optional attributes are all present or none is present at all.
As a trade-off, allow PKCS#11 client to partially provide them but do not load them into the TEE object unless they are all present.
Fixes: 3dc4089afde2 ("ta: pkcs11: correct RSA keys extended attributes sanitation") Closes: https://github.com/OP-TEE/optee_os/issues/5418 Closes: https://github.com/OP-TEE/optee_os/issues/7520 Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
show more ...
|
| 14a1a72b | 15-Oct-2025 |
Etienne Carriere <etienne.carriere@st.com> |
ta: remoteproc: clarify remoteproc_get_tlv() behavior
Add an inline comment to explicitly state that TA remoteproc local function remoteproc_get_tlv() loads specific values in its output arguments w
ta: remoteproc: clarify remoteproc_get_tlv() behavior
Add an inline comment to explicitly state that TA remoteproc local function remoteproc_get_tlv() loads specific values in its output arguments when it returns with error code TEE_ERROR_NO_DATA. This way it is clearer that caller expect such values on such error cases.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
show more ...
|
| 68dc1d62 | 17-Sep-2025 |
Etienne Carriere <etienne.carriere@st.com> |
ta: remoteproc: clarify case empty key info is last TLV cell
Clarify case when remote processor firmware key info TLV RPROC_TLV_PKEYINFO is present but empty (size = 0) and is placed last in the TLV
ta: remoteproc: clarify case empty key info is last TLV cell
Clarify case when remote processor firmware key info TLV RPROC_TLV_PKEYINFO is present but empty (size = 0) and is placed last in the TLVs memory area hence its value cell start address matches the TLV area end address. The previous implementation was fine but it looked odd the main loop does not address the case.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
show more ...
|
| 07917406 | 05-Aug-2025 |
Alexandre Gonzalo <alexandre.gonzalo@arm.com> |
remoteproc: fix potential overflows in TLV parsing
This commit is fixing two issues: - Verify that the end of the buffer is not reached before reading the tag and value. - Verify that the entire TLV
remoteproc: fix potential overflows in TLV parsing
This commit is fixing two issues: - Verify that the end of the buffer is not reached before reading the tag and value. - Verify that the entire TLV fits into the TLV chunk
Signed-off-by: Alexandre Gonzalo <alexandre.gonzalo@arm.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| f03a2aca | 09-Jul-2025 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta/link.mk: update the default TA encryption key
When the TA signing key for OP-TEE was changed [1], the TA encryption key (which is a derived key) was not updated. As a result, CFG_ENCRYPT_TA=y is
ta/link.mk: update the default TA encryption key
When the TA signing key for OP-TEE was changed [1], the TA encryption key (which is a derived key) was not updated. As a result, CFG_ENCRYPT_TA=y is broken. Fix that by updating TA_ENC_KEY to reflect the output of tee_otp_get_ta_enc_key(). The key value is obtained by adding 'DHEXDUMP(buffer, len);' to tee_otp_get_ta_enc_key() then running any test involving loading an encrypted TA. For example: build$ make check CFG_ENCRYPT_TA=y CHECK_TESTS=xtest XTEST_ARGS=4002 build$ vi ../out/bin/serial0.log
Fixes: 5d5d7d0b1c03 ("keys: increase default RSA key size to 4096 bits") [1] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 941a58d7 | 04-Apr-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add optee.ta.instanceKeepCrashed property
Add the optee.ta.instanceKeepCrashed property to prevent a TA with gpd.ta.instanceKeepAlive=true to be restarted. This prevents unexpected resetting of the
Add optee.ta.instanceKeepCrashed property
Add the optee.ta.instanceKeepCrashed property to prevent a TA with gpd.ta.instanceKeepAlive=true to be restarted. This prevents unexpected resetting of the state of the TA.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Alex Lewontin <alex.lewontin@canonical.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 0ae5ef34 | 03-Apr-2025 |
Thomas Bourgoin <thomas.bourgoin@foss.st.com> |
tree wide: fix header files dependencies in linker files
When linking with a generated linker script like kern.ld.S, dependencies with header file are not regenerated. Same issue as commit acdc32afe
tree wide: fix header files dependencies in linker files
When linking with a generated linker script like kern.ld.S, dependencies with header file are not regenerated. Same issue as commit acdc32afe18f ("mk/compile.mk: fix header dependency in .d file")
Add option -MP used to fix error generated when removing header files.
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 228cf40e | 28-Mar-2025 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
tree-wide: use /usr/bin/env bash in bash scripts
Some distributions don't provide bash inside of /bin, increase compatibility by using env to resolve the correct path at runtime. Fixes running the s
tree-wide: use /usr/bin/env bash in bash scripts
Some distributions don't provide bash inside of /bin, increase compatibility by using env to resolve the correct path at runtime. Fixes running the scripts on my NixOS systems.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| f84dc262 | 27-Mar-2025 |
Alvin Chang <alvinga@andestech.com> |
ta: Compile TA with "-fno-stack-protector" if TA stack protector is off
Depends on compiler version and OS distributions, the stack protector may be enabled by default. This means TA is always compi
ta: Compile TA with "-fno-stack-protector" if TA stack protector is off
Depends on compiler version and OS distributions, the stack protector may be enabled by default. This means TA is always compiled with "-fstack-protector", even if _CFG_TA_STACK_PROTECTOR is not 'y'.
To solve this issue, we explicitly provide "-fno-stack-protector" compile option when _CFG_TA_STACK_PROTECTOR is not 'y'. Thus, the TA stack protector is definitely disabled.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ab03d590 | 27-Mar-2025 |
Alvin Chang <alvinga@andestech.com> |
ta: Export _CFG_TA_STACK_PROTECTOR
_CFG_TA_STACK_PROTECTOR is config variable referenced in __ta_entry() to generate random stack canary. Thus, it needs to be exported to TA makefile.
Signed-off-by
ta: Export _CFG_TA_STACK_PROTECTOR
_CFG_TA_STACK_PROTECTOR is config variable referenced in __ta_entry() to generate random stack canary. Thus, it needs to be exported to TA makefile.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 1283e108 | 27-Mar-2025 |
Alvin Chang <alvinga@andestech.com> |
ta: Pass config variables prefixed as _CFG_ from conf.mk to build flags
In addition to config variables prefixed as CFG_, some other config variables are prefixed as _CFG_ and also referenced during
ta: Pass config variables prefixed as _CFG_ from conf.mk to build flags
In addition to config variables prefixed as CFG_, some other config variables are prefixed as _CFG_ and also referenced during TA compilation. Add _CFG_ config variables to be compiler flags.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 886b8adb | 20-Mar-2025 |
Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> |
build: always link in-tree TAs with the -static flag
Shared libraries may remain in the output directory as artifacts from previous builds, causing unintended behavior. To prevent this, in-tree TAs
build: always link in-tree TAs with the -static flag
Shared libraries may remain in the output directory as artifacts from previous builds, causing unintended behavior. To prevent this, in-tree TAs are now always linked using the -static flag, regardless of whether shared libraries are enabled.
Signed-off-by: Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 949b0c0c | 15-Jan-2025 |
Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> |
ta: enable ubsan support for TAs
Introduce CFG_TA_SANITIZE_UNDEFINED config to sanitize trusted applications. If CFG_TA_SANITIZE_UNDEFINED is set sanitize flags are propagated to internal TAs (avb,
ta: enable ubsan support for TAs
Introduce CFG_TA_SANITIZE_UNDEFINED config to sanitize trusted applications. If CFG_TA_SANITIZE_UNDEFINED is set sanitize flags are propagated to internal TAs (avb, pkcs11, remoteproc, trusted_keys) and external TAs, which are built with the devkit.
Signed-off-by: Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6b1c1858 | 06-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
Deprecate libgcc for TAs
By default keep linking with libgcc for TAs, but add CFG_TA_LIBGCC to easily turn off linking with libgcc in configurations where it isn't needed.
Signed-off-by: Jens Wikla
Deprecate libgcc for TAs
By default keep linking with libgcc for TAs, but add CFG_TA_LIBGCC to easily turn off linking with libgcc in configurations where it isn't needed.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 695be9d6 | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor the MDBG malloc functions
Replace the MDBG malloc functions and macros with a new function __mdbg_alloc() handling all the memory allocations similar to mem_alloc(). The old MDBG
libutils: refactor the MDBG malloc functions
Replace the MDBG malloc functions and macros with a new function __mdbg_alloc() handling all the memory allocations similar to mem_alloc(). The old MDBG macros are replace by new macros calling __mdbg_alloc().
mem_alloc(), mem_alloc_unlocked(), and mem_free() are updated to handle configuration with and without MDBG, removing the all the ENABLE_MDBG ifdefs in the C file.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| c385a722 | 06-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: trusted_keys: Add TA version and description property values
Add meaningful values for Trusted Keys TA version and description properties to replace previously embedded default respective values
ta: trusted_keys: Add TA version and description property values
Add meaningful values for Trusted Keys TA version and description properties to replace previously embedded default respective values "Undefined version" and "Undefined description".
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1ed12b2e | 06-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: avb: Add TA version and description property values
Add meaningful values for AVB TA version and description properties to replace previously embedded default respective values "Undefined versio
ta: avb: Add TA version and description property values
Add meaningful values for AVB TA version and description properties to replace previously embedded default respective values "Undefined version" and "Undefined description".
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 04e46975 | 16-Dec-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Je
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5395f036 | 06-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: set TA version ID to 1.0.0
PKCS#11 TA version ID is 0.1.0 since its early integration. Let's set it 1.0.0 since it now mature enough to deserve a non-zero major version number.
Signed-o
ta: pkcs11: set TA version ID to 1.0.0
PKCS#11 TA version ID is 0.1.0 since its early integration. Let's set it 1.0.0 since it now mature enough to deserve a non-zero major version number.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8cf8403b | 11-Dec-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: default disable CFG_PKCS11_TA_RSA_X_509
Disable CFG_PKCS11_TA_RSA_X_509 in pkcs11 TA default configuration since raw RSA signature (CKM_RSA_X_509) computation and verification can be uns
ta: pkcs11: default disable CFG_PKCS11_TA_RSA_X_509
Disable CFG_PKCS11_TA_RSA_X_509 in pkcs11 TA default configuration since raw RSA signature (CKM_RSA_X_509) computation and verification can be unsafe. Target systems willing to embed its support (e.g. for some TSL v1.2 support) will need to enable it explicitly.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| b7abff72 | 06-Sep-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: add CKM_RSA_X_509 ciphering
Add support for CKM_RSA_X_509 mechanism for encrypt/decrypt operations.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne
ta: pkcs11: add CKM_RSA_X_509 ciphering
Add support for CKM_RSA_X_509 mechanism for encrypt/decrypt operations.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| e02f17f3 | 24-Jul-2024 |
Alexandre Marechal <alexandre.marechal@st.com> |
ta: pkcs11: add CKM_RSA_X_509 authentication
Add support for CKM_RSA_X_509 mechanism for sing/verify operations.
Sign and verify operations are processed using TEE decrypt/encrypt operation since G
ta: pkcs11: add CKM_RSA_X_509 authentication
Add support for CKM_RSA_X_509 mechanism for sing/verify operations.
Sign and verify operations are processed using TEE decrypt/encrypt operation since GP TEE Internal Core API specification only allows these modes for TEE_ALG_RSA_NOPAD algorithm. The pkcs11 TA only support sign operation when the provided payload is exactly of the same size as the RSA key used and checks the generate signature is of right size.
This mechanism can be needed to support CKM_RSA_X_509 for TLSv1.2 connections.
Add CFG_PKCS11_TA_RSA_X_509 to allow configuring the pkcs11 TA with or without raw RSA crypto support. The config switch is default enabled.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| fc9ea0db | 19-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
ta_dev_kit.mk: use spec-srcs and spec-out-dir
The commit cfa34d9afb5c ("Add support for compiling in-tree TAs") added spec-srcs and spec-out-dir for special handling of user_ta_header.c when compili
ta_dev_kit.mk: use spec-srcs and spec-out-dir
The commit cfa34d9afb5c ("Add support for compiling in-tree TAs") added spec-srcs and spec-out-dir for special handling of user_ta_header.c when compiling in-tree TAs.
However, these variables are just as relevant for out-of-tree TAs compiled via ta/mk/ta_dev_kit.mk. So as a simplification switch to use spec-srcs and spec-out-dir in that file too.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 19662e41 | 20-Sep-2024 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta: apply __no_stack_protector to __ta_entry() or __ta_entry_c()
Apply the __no_stack_protector attribute to the first C function called following the TA entry point (i.e., __ta_entry(), or for the
ta: apply __no_stack_protector to __ta_entry() or __ta_entry_c()
Apply the __no_stack_protector attribute to the first C function called following the TA entry point (i.e., __ta_entry(), or for the special case of ARM32, __ta_entry_c()). This is required because __stack_chk_guard is initialized in this very function, therefore stack protection cannot be assumed to be functional at this point.
Fixes a TA crash on QEMUv7 with Clang 18.1.7 [1].
Link: https://github.com/OP-TEE/optee_os/issues/7047 [1] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Khoa Hoang <admin@khoahoang.com>
show more ...
|
| 55a4d839 | 04-Sep-2024 |
Georges Savoundararadj <savoundg@amazon.com> |
ta: pkcs11: fix memory leak
On update_persistent_object_attributes failure, head_new (stored in obj->attributes) is not freed, causing a memory leak.
Reported-by: Christian Zoia <czoia@amazon.es> C
ta: pkcs11: fix memory leak
On update_persistent_object_attributes failure, head_new (stored in obj->attributes) is not freed, causing a memory leak.
Reported-by: Christian Zoia <czoia@amazon.es> Closes: https://github.com/OP-TEE/optee_os/issues/7023 Fixes: 6959626e1621 ("ta: pkcs11: preserve object when set attribute fails") Signed-off-by: Georges Savoundararadj <savoundg@amazon.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|