| 1fdb1c4f | 05-Sep-2022 |
Jelle Sels <jelle.sels@arm.com> |
ffa: Export ffa.h to be used by host
The ffa.h file is needed by the OP-TEE test suite. Export it so it can be used by it.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Acked-by: Jerome Forissier
ffa: Export ffa.h to be used by host
The ffa.h file is needed by the OP-TEE test suite. Export it so it can be used by it.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d9925536 | 23-Aug-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
arm32: libutils, libutee, ta: add .note.GNU-stack section to .S files
When building for arm32 with GNU binutils 2.39, the linker outputs warnings when linking Trusted Applications:
arm-unknown-lin
arm32: libutils, libutee, ta: add .note.GNU-stack section to .S files
When building for arm32 with GNU binutils 2.39, the linker outputs warnings when linking Trusted Applications:
arm-unknown-linux-uclibcgnueabihf-ld.bfd: warning: utee_syscalls_a32.o: missing .note.GNU-stack section implies executable stack arm-unknown-linux-uclibcgnueabihf-ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
We could silence the warning by adding the '--no-warn-execstack' option to the TA link flags, like we did in the parent commit for the TEE core and ldelf. Indeed, ldelf always allocates a non-executable piece of memory for the TA to use as a stack.
However it seems preferable to comply with the common ELF practices in this case. A better fix is therefore to add the missing .note.GNU-stack sections in the assembler files.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7716295e | 29-Jun-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
build: use CFLAGS_ta_armXX etc. when building in-tree TAs
In-tree TAs currently ignore CFLAGS_ta_arm32/CFLAGS_ta_arm64 and CPPFLAGS_ta_arm32/CPPFLAGS_ta_arm64, contrary to out-of tree TAs which are
build: use CFLAGS_ta_armXX etc. when building in-tree TAs
In-tree TAs currently ignore CFLAGS_ta_arm32/CFLAGS_ta_arm64 and CPPFLAGS_ta_arm32/CPPFLAGS_ta_arm64, contrary to out-of tree TAs which are built with ta/mk/ta_dev_kit.mk. Add these flags for convenience and consistency.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 9325ea3d | 29-Jun-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta: pkcs11: fix use-after-free in close_ck_session() when CFG_TEE_TA_LOG_LEVEL >= 3
The debug trace in close_ck_session() needs to be moved before the session is freed. Problem found with CFG_MEMTAG
ta: pkcs11: fix use-after-free in close_ck_session() when CFG_TEE_TA_LOG_LEVEL >= 3
The debug trace in close_ck_session() needs to be moved before the session is freed. Problem found with CFG_MEMTAG=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a0e8ffe9 | 04-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add support for MTE
Adds support for the Armv8.5-A Memory Tagging Extension with CFG_MEMTAG=y.
A memtag.h API is introduced to handle this extension. If CFG_MEMTAG=n the API doesn't add any o
core: add support for MTE
Adds support for the Armv8.5-A Memory Tagging Extension with CFG_MEMTAG=y.
A memtag.h API is introduced to handle this extension. If CFG_MEMTAG=n the API doesn't add any overhead and the behaviour is unchanged. With CFG_MEMTAG=y a check is performed to see if the platform can support MTE and the API is dynamically configured accordingly. This means that it's safe to have CFG_MEMTAG=y even for platforms not supporting MTE. There will be some minimal overhead then, but likely not noticeable.
An entry is also added in the TEE_PROPSET_TEE_IMPLEMENTATION for a u32 property "org.trustedfirmware.optee.cpu.feat_memtag_implemented". The property is set to a non-zero value only if CFG_CORE_MEMTAG is configured and the underlying CPU supports FEAT_MTE.
This commit still only uses the default tag with the value 0 resulting in unchanged pointers when accessing memory. However, all plumbing is in place allowing for instance tagging of the heap in a later commit.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8f276f29 | 28-Jan-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
ta: pkcs11: PKCS11_CKM_AES_CBC_PAD is not supported
Remove PKCS11_CKM_AES_CBC_PAD from the list of the supported mechanism as it is not implemented by the TA.
Fixes: https://github.com/OP-TEE/optee
ta: pkcs11: PKCS11_CKM_AES_CBC_PAD is not supported
Remove PKCS11_CKM_AES_CBC_PAD from the list of the supported mechanism as it is not implemented by the TA.
Fixes: https://github.com/OP-TEE/optee_os/issues/5142 Acked-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 7e05ec25 | 27-Oct-2021 |
Jerome Forissier <jerome@forissier.org> |
core: pta: add remote attestation PTA
Add a PTA to perform remote attestation of user space TAs and TEE core memory. Enabled with CFG_ATTESTATION_PTA=y. Four commands are defined:
- PTA_ATTESTATION
core: pta: add remote attestation PTA
Add a PTA to perform remote attestation of user space TAs and TEE core memory. Enabled with CFG_ATTESTATION_PTA=y. Four commands are defined:
- PTA_ATTESTATION_GET_PUBKEY
Returns the public RSA key used to sign the measurements generated by the other commands. The key pair is generated on first call (any command) and saved to secure storage. It is therefore device-specific.
- PTA_ATTESTATION_GET_TA_SHDR_DIGEST
Returns the digest found in the secure header (struct shdr) of a TA or trusted shared library given its UUID.
- PTA_ATTESTATION_HASH_TA_MEMORY
This command must be called by a user space TA (not a CA). It computes a hash of the memory pages that belong to the caller and contain code or read-only data. This hash is therefore a runtime measurement of the TA execution environment, including shared libraries (if any). It can be used to remotely attest that the device is running untampered TA code.
- PTA_ATTESTATION_HASH_TEE_MEMORY
Returns a hash of the TEE OS core (.text and .rodata sections, less the small part of .text that may be modified at boot). Similar to PTA_ATTESTATION_HASH_TA_MEMORY, the hash is computed each time the command is called, so that the result reflects the actual memory content.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cc062b46 | 23-Feb-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
ta: pkcs11: support for ECDH1_DERIVE
Add support for ECDH1_DERIVE operation.
Only the key derivation function CKD_NULL is supported: the raw shared secret value is therefore generated without apply
ta: pkcs11: support for ECDH1_DERIVE
Add support for ECDH1_DERIVE operation.
Only the key derivation function CKD_NULL is supported: the raw shared secret value is therefore generated without applying any key derivation function.
Tested with pkcs11_tool -m ECDH1-DERIVE
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Co-developed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f0d8ad67 | 20-Jan-2022 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: Export CFG_TA_PAUTH
Export CFG_TA_PAUTH for availability when compiling xtest
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Re
ta: Export CFG_TA_PAUTH
Export CFG_TA_PAUTH for availability when compiling xtest
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 76948876 | 15-Dec-2021 |
Mengchi Cheng <mengcc@amazon.com> |
ta: pkcs11: Clean up temporary_object_list on object creation failure
Calls LIST_REMOVE() only from cleanup_volatile_obj_ref() this is always called to finalize object release. Allocated objects are
ta: pkcs11: Clean up temporary_object_list on object creation failure
Calls LIST_REMOVE() only from cleanup_volatile_obj_ref() this is always called to finalize object release. Allocated objects are always inserted into a list after being created and therefore need to be removed for its owner list before the memory is released.
This changes fixes an issue when handle_get() failed in create_object() and does not remove the reference from temporary_object_list.
Signed-off-by: Mengchi Cheng <mengcc@amazon.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 48685b6c | 16-Dec-2021 |
Jerome Forissier <jerome@forissier.org> |
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI
arm64: bti: fail link phase if some objects do not support BTI
Adds the proper linker options (-z force-bti --fatal-warnings) to fail the link if some object files lack the BTI feature bit when BTI is requested (CFG_CORE_BTI=Y, CFG_TA_BTI=y). The options are added for tee.elf, ldelf.elf, in-tree TAs, in-tree user space shared libraries (CFG_ULIBS_SHARED=y) as well as for external TAs and shared libraries built with the dev kit.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org>
show more ...
|
| 5a8d8ba3 | 01-Dec-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: Export CFG_TA_BTI
Export CFG_TA_BTI for availability when compiling xtest
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by:
ta: Export CFG_TA_BTI
Export CFG_TA_BTI for availability when compiling xtest
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7a6682fc | 13-Dec-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
Move section .note.gnu.property after .text in lds files
It is observed that clang compiler sometimes places the .note.gnu.property at offset 0. For TA's, the loader expects the user_ta_header at th
Move section .note.gnu.property after .text in lds files
It is observed that clang compiler sometimes places the .note.gnu.property at offset 0. For TA's, the loader expects the user_ta_header at that location while for ldelf, _ldelf_start() is expected at this point. To avoid such conflicts place this section after the text section.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dbc2184e | 08-Dec-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
ta: pkcs11: Fix memory leak
When sanitizing indirect templates, obj2 was getting allocated twice leading to memory leak.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne
ta: pkcs11: Fix memory leak
When sanitizing indirect templates, obj2 was getting allocated twice leading to memory leak.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Fixes: https://github.com/OP-TEE/optee_os/issues/5022
show more ...
|
| 5818fdfd | 07-Dec-2021 |
Sahil Malhotra <sahil.malhotra@nxp.com> |
ta: pkcs11: increase default heap size to 32kB
In some test cases, 16kB memory configured is not enough, specifically while generating RSA keys, so increasing the default heap size to 32kB.
Signed-
ta: pkcs11: increase default heap size to 32kB
In some test cases, 16kB memory configured is not enough, specifically while generating RSA keys, so increasing the default heap size to 32kB.
Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com> Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 28eb53ac | 25-Nov-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
ta: pkcs11: remove unnecessary code
Remove unnecessary assignment.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> |
| 728777ac | 29-Nov-2021 |
Jerome Forissier <jerome@forissier.org> |
build: use CFLAGS32/CFLAGS64 when building in-tree TAs
Commit 19fdfcf617e3 ("build: ldelf and TAs can rely on CFLAGS32/CFLAGS64") only partially implements what is mentioned in the commit descriptio
build: use CFLAGS32/CFLAGS64 when building in-tree TAs
Commit 19fdfcf617e3 ("build: ldelf and TAs can rely on CFLAGS32/CFLAGS64") only partially implements what is mentioned in the commit description. The ldelf part is OK, but in-tree TAs still don't use CFLAGS32 or CFLAGS64. The reason is that the submodule name $(sm) is not ta_arm32 or ta_arm64 like for TAs build with the "dev kit". Instead, $(sm) is the name of the directory (such as "avb" for core/ta/avb, "pkcs11" for core/ta/pkcs11, etc.). Therefore, it is not arch-bits-ta_arm32 or arch-bits-ta_arm64 that needs to be set but arch-bits-$(sm).
Fixes: 19fdfcf617e3 ("build: ldelf and TAs can rely on CFLAGS32/CFLAGS64") Signed-off-by: Jerome Forissier <jerome@forissier.org> Tested-by: Ralph Siemsen <ralph.siemsen@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9c3a1069 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
avb: Fix warnings in ta/avb/entry.c
Fixes -Wdeclaration-after-statement warnings in ta/avb/entry.c: ta/avb/entry.c: In function ‘write_persist_value’: ta/avb/entry.c:267:2: error: ISO C90 forbids mi
avb: Fix warnings in ta/avb/entry.c
Fixes -Wdeclaration-after-statement warnings in ta/avb/entry.c: ta/avb/entry.c: In function ‘write_persist_value’: ta/avb/entry.c:267:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char *name_buf = params[0].memref.buffer; ^~~~ ta/avb/entry.c: In function ‘read_persist_value’: ta/avb/entry.c:316:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] char *name_buf = params[0].memref.buffer; ^~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a5ea52c2 | 08-Oct-2021 |
Elvira Khabirova <e.khabirova@omp.ru> |
ta: pkcs11: fix a double-free
entry_processing_key() frees out_buf on error from derive_key_by_symm_enc(). Before this change, that led to a double-free.
Fixes: 8c499324e457 ("ta: pkcs11: Add funct
ta: pkcs11: fix a double-free
entry_processing_key() frees out_buf on error from derive_key_by_symm_enc(). Before this change, that led to a double-free.
Fixes: 8c499324e457 ("ta: pkcs11: Add function to set key data") Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
show more ...
|
| b7964037 | 08-Oct-2021 |
Elvira Khabirova <e.khabirova@omp.ru> |
ta: pkcs11: fix a memory leak
Before this change, entry_find_objects_init() leaked e.g. find_ctx.
Fixes: fa1ac7676f39 ("ta: pkcs11: Don't load objects that don't match the search during find") Revi
ta: pkcs11: fix a memory leak
Before this change, entry_find_objects_init() leaked e.g. find_ctx.
Fixes: fa1ac7676f39 ("ta: pkcs11: Don't load objects that don't match the search during find") Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
show more ...
|
| 830faade | 21-Oct-2021 |
Jerome Forissier <jerome@forissier.org> |
ta_dev_kit.mk: remove extra -o when creating static library
The archiver command: $(AR$(sm)) is not supposed to take a -o argument to specify its output, contrary to the linker for instance.
When G
ta_dev_kit.mk: remove extra -o when creating static library
The archiver command: $(AR$(sm)) is not supposed to take a -o argument to specify its output, contrary to the linker for instance.
When GNU ar is used, -o is simply ignored. However when LLVM ar is used an error is printed. Therefore remove this unwanted -o.
Fixes: 9faf0da7b854 ("mk: add library common makefile support") Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| be501eb1 | 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carrie
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4137952d | 23-Jan-2021 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
ta: pkcs11: Add certificate object support
Adds support for:
PKCS #11 Cryptographic Token Interface Base Specification Version 2.40 Plus Errata 01
4.6 Certificate objects 4.6.3 X.509 public key ce
ta: pkcs11: Add certificate object support
Adds support for:
PKCS #11 Cryptographic Token Interface Base Specification Version 2.40 Plus Errata 01
4.6 Certificate objects 4.6.3 X.509 public key certificate objects
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 0ef6b144 | 25-Sep-2021 |
Victor Chong <victor.chong@linaro.org> |
ta: pkcs11: Add support for AES CMAC mechanisms
Add support for CKM_AES_CMAC* mechanisms.
Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linar
ta: pkcs11: Add support for AES CMAC mechanisms
Add support for CKM_AES_CMAC* mechanisms.
Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org>
show more ...
|
| 0ee43c37 | 23-Sep-2021 |
Clement Faure <clement.faure@nxp.com> |
ta_dev_kit.mk: set CFLAGS32 and CFLAGS64 to $(CFLAGS) by default
Prior to commit 19fdfcf617e3 ("build: ldelf and TAs can rely on CFLAGS32/CFLAGS64") was $(arch-bits-$(sm)) not set for TAs (note: $(s
ta_dev_kit.mk: set CFLAGS32 and CFLAGS64 to $(CFLAGS) by default
Prior to commit 19fdfcf617e3 ("build: ldelf and TAs can rely on CFLAGS32/CFLAGS64") was $(arch-bits-$(sm)) not set for TAs (note: $(sm) is the submodule name, i.e., ta_arm32 or ta_arm64 for TAs). As a result, $$(CFLAGS$$(arch-bits-$$(comp-sm-$2))) expanded to the value of CFLAGS in mk/compile.mk. With the introduction of the above commit, $(arch-bits-$(sm)) is always set to 32 or 64 depending on the TA architecture, so mk/compile.mk now evaluates $(CFLAGS32) or $(CFLAGS64). In order to keep the previous behavior while still allowing specific overrides for 32 or 64-bit, set CFLAGS32 and CFLAGS64 to $(CFLAGS) by default. This is consistent with what was done for other submodules in commit b09cddcab1ee ("Introduce CFLAGS32 and CFLAGS64").
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|