| 7e75ca54 | 01-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
Basic fault mitigation routines
Adds basic fault mitigation routines designed to help protecting from fault injection attacks on the hardware. This is by no means bullet proof, but it should at leas
Basic fault mitigation routines
Adds basic fault mitigation routines designed to help protecting from fault injection attacks on the hardware. This is by no means bullet proof, but it should at least improve the situation.
These routines focus on verifying that a function has been called and that the returned value matches the result from the function. This is done by having a handshake between the caller and the callee where also the return value is transmitted in a separate channel.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7eaed3a3 | 23-Nov-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: prefix system header guard with 2 underscore chars
Adds prefix "__" to standard header files implemented in libutils. This is applicable as these header guards macro are system macros. Thi
libutils: prefix system header guard with 2 underscore chars
Adds prefix "__" to standard header files implemented in libutils. This is applicable as these header guards macro are system macros. This change prevents conflicts with external component as faced with SCP-firmware [1] that implements wrapper headers with #include_next for assert.h and stdlib.h using ASSERT_H [2] and STDLIB_H [3] as header guards as in libutils.
Prior this change did stdint.h both define STDINT_H and _STDINT_H but guards only upon STDINT_H. This change removes STDINT_H.
Link: [1] https://github.com/ARM-software/SCP-firmware.git Link: [2] https://github.com/ARM-software/SCP-firmware/blob/v2.11.0/framework/include/assert.h#L8-L9 Link: [3] https://github.com/ARM-software/SCP-firmware/blob/v2.11.0/framework/include/stdlib.h#L8-L9 Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| bc8fe8c2 | 22-Nov-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: implement aligned_alloc()
Implements aligned_alloc() in bget_malloc.c based on memalign(). The implementation also covers when ENABLE_MDBG is enabled, that is when CFG_TEE_CORE_MALLOC_DEBU
libutils: implement aligned_alloc()
Implements aligned_alloc() in bget_malloc.c based on memalign(). The implementation also covers when ENABLE_MDBG is enabled, that is when CFG_TEE_CORE_MALLOC_DEBUG is enabled.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| cb94c145 | 21-Oct-2022 |
Weizhao Jiang <weizhaoj@amazon.com> |
core: implement a method to dump user TA runtime status
This patch is to dump user TA runtime status for debug purposes. The change includes: 1. Add new command (STATS_CMD_TA_STATS) in the stats PTA
core: implement a method to dump user TA runtime status
This patch is to dump user TA runtime status for debug purposes. The change includes: 1. Add new command (STATS_CMD_TA_STATS) in the stats PTA. 2. Add tee_ta_dump_stats() to scan all ongoing TA instance and sessions and snapshot their status. 3. Add new function: entry_dump_memstats() to __utee_entry() to get TA heap statistics. 4. Add new compile option (CFG_TA_STATS, default n) to enable this feature.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com> [jf: edit commit message] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| d29e68dd | 02-Nov-2022 |
Weizhao Jiang <weizhaoj@amazon.com> |
libutee: change __utee_entry() handling on unknown function IDs
Change __utee_entry() to return TEE_ERROR_NOT_SUPPORTED instead panicking when handling unknown entry function IDs.
Reviewed-by: Jens
libutee: change __utee_entry() handling on unknown function IDs
Change __utee_entry() to return TEE_ERROR_NOT_SUPPORTED instead panicking when handling unknown entry function IDs.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com> [jf: edit commit message] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 1c025012 | 26-Oct-2022 |
Simon Ott <simon.ott@aisec.fraunhofer.de> |
libmbedtls: mbedtls_config_uta.h: enable chacha20 and chachapoly support
Extend the mbedtls UTA configuration to support the ciphers chacha20 and chachapoly for usage in custom TAs, as they are supp
libmbedtls: mbedtls_config_uta.h: enable chacha20 and chachapoly support
Extend the mbedtls UTA configuration to support the ciphers chacha20 and chachapoly for usage in custom TAs, as they are supported by common protocols, such as TLS1.3, IPsec or WireGuard
Signed-off-by: Simon Ott <simon.ott@aisec.fraunhofer.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 23ef3871 | 26-Oct-2022 |
Simon Ott <simon.ott@aisec.fraunhofer.de> |
libmbedtls: fix cipher_wrap.c for chacha20 and chachapoly
For chacha20 and chachapoly, the *_ctx_clone() function is missing and therefore the wrong function pointers are assigned to .ctx_clone_func
libmbedtls: fix cipher_wrap.c for chacha20 and chachapoly
For chacha20 and chachapoly, the *_ctx_clone() function is missing and therefore the wrong function pointers are assigned to .ctx_clone_func and .ctx_free_func when MBEDTLS_CHACHA20_C or MBEDTLS_CHACHAPOLY_C is enabled.
Signed-off-by: Simon Ott <simon.ott@aisec.fraunhofer.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| eac16613 | 01-Sep-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
lib: mbedtls: rsa: support the crypto driver
Allow the software implementation to coexist with the crypto driver API.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jens Wikla
lib: mbedtls: rsa: support the crypto driver
Allow the software implementation to coexist with the crypto driver API.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4afd9f03 | 01-Sep-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
libutils: compiler.h: introduce __alias(x)
Improve readability with an __alias definition. Supports the __weak __alias("g") use case
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed
libutils: compiler.h: introduce __alias(x)
Improve readability with an __alias definition. Supports the __weak __alias("g") use case
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0d4767a9 | 17-Oct-2022 |
Zengxx <zengxiaoxu@huawei.com> |
libutils: brel: bugfix memset scope larger than expected
In the case of wipe = true and previous buffer is free, memset the current buffer, rather then current buffer with previous free buffer.
Sig
libutils: brel: bugfix memset scope larger than expected
In the case of wipe = true and previous buffer is free, memset the current buffer, rather then current buffer with previous free buffer.
Signed-off-by: Zengxx <zengxiaoxu@huawei.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Guangwei Zhou <zhouguangwei5@huawei.com>
show more ...
|
| d3ed98ee | 20-Oct-2022 |
Clement Faure <clement.faure@nxp.com> |
libutils: util.h: fix the ROUNDUP_OVERFLOW() macro
Some parenthesis are missing in the ROUNDUP_OVERFLOW expression. The macro can only return false.
Fixes: 2e48af989133 ("util.h: add the macro ROUN
libutils: util.h: fix the ROUNDUP_OVERFLOW() macro
Some parenthesis are missing in the ROUNDUP_OVERFLOW expression. The macro can only return false.
Fixes: 2e48af989133 ("util.h: add the macro ROUNDUP_OVERFLOW()") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e1f9cee7 | 12-Aug-2022 |
Sergiy Kibrik <Sergiy_Kibrik@epam.com> |
libutee: add Ed25519 support
This commit adds Ed25519 support as defined in TEE Internal Core API v1.3.1
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> Signed-off-by: Valerii Chubar <valerii
libutee: add Ed25519 support
This commit adds Ed25519 support as defined in TEE Internal Core API v1.3.1
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> Signed-off-by: Valerii Chubar <valerii_chubar@epam.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 49cfa41e | 08-Sep-2022 |
Gavin <zheting0815@gmail.com> |
libutils:assert.h:add compiler check for static_assert
static_assert is belong to reserved word since C++11. We only need this definition when not using C++ or the C++ version less than C++11.
Sign
libutils:assert.h:add compiler check for static_assert
static_assert is belong to reserved word since C++11. We only need this definition when not using C++ or the C++ version less than C++11.
Signed-off-by: Gavin Liu <Gavin.Liu@mediatek.com> Reviewed-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 ...
|
| 0e4dbede | 13-Jul-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
libutee: add SHA3 algorithm identifiers
Add SHA3 algorithm identifiers from TEE Internal Core API Specification Public Release v1.3.1.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Review
libutee: add SHA3 algorithm identifiers
Add SHA3 algorithm identifiers from TEE Internal Core API Specification Public Release v1.3.1.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 8dc184e5 | 18-Jul-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
libutils: util.h: add get_field_u{32,64}() and set_field_u{32,64}()
This commit defines macros for getting and setting bit fields.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Revie
libutils: util.h: add get_field_u{32,64}() and set_field_u{32,64}()
This commit defines macros for getting and setting bit fields.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 4ddaad52 | 12-Aug-2022 |
Lars Persson <larper@axis.com> |
core: mbedtls: Add ECC signature size check
The ECC signature implementation must check that the output buffer has sufficient space to store the signature. This check was missing in the mbedtls vers
core: mbedtls: Add ECC signature size check
The ECC signature implementation must check that the output buffer has sufficient space to store the signature. This check was missing in the mbedtls version of ecc_sign.
Fixes: ad6cfae7c0 ("libmbedtls: support mbedtls ECC function") Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Lars Persson <lars.persson@axis.com>
show more ...
|
| 7910f4d8 | 12-Aug-2022 |
Lars Persson <larper@axis.com> |
core: mbedtls: Use a DRBG to speed up RSA key generation
The output rate of a TRNG is quite slow and this has a big impact on the time needed to generate an RSA key since that process does require a
core: mbedtls: Use a DRBG to speed up RSA key generation
The output rate of a TRNG is quite slow and this has a big impact on the time needed to generate an RSA key since that process does require a lot of random bits to find prime numbers.
We instantiate a CTR DRBG that is seeded from the TRNG to provide a higher-speed source of random bits.
Performance comparison for rsa 2048 key generation on our device with a TRNG that outputs on the order of 1e5 bits per second.
Before patch (14 samples) mean time 14.02 sec stddev. 7.91
With patch (14 samples): mean time 1.67 sec stddev. 1.24
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Lars Persson <larper@axis.com>
show more ...
|
| 039e02df | 09-Aug-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
Squashed commit upgrading to mbedtls-2.28.1
Squash merging branch import/mbedtls-2.28.1
ebf1f6a58089 ("libmbedtls: compile new files added with 2.28.1") 3ffb51b58a54 ("libmbedtls: add SM2 curve")
Squashed commit upgrading to mbedtls-2.28.1
Squash merging branch import/mbedtls-2.28.1
ebf1f6a58089 ("libmbedtls: compile new files added with 2.28.1") 3ffb51b58a54 ("libmbedtls: add SM2 curve") c425755720b4 ("libmbedtls: mbedtls_mpi_exp_mod(): optimize mempool usage") 23493c822a82 ("libmbedtls: mbedtls_mpi_exp_mod(): reduce stack usage") dcdca2348dff ("libmbedtls: mbedtls_mpi_exp_mod() initialize W") dc2994976958 ("libmbedtls: fix no CRT issue") c6628873b281 ("libmbedtls: add interfaces in mbedtls for context memory operation") 8acd202d3e55 ("libmedtls: mpi_miller_rabin: increase count limit") 37284e28d5d9 ("libmbedtls: add mbedtls_mpi_init_mempool()") b499a75f29f3 ("libmbedtls: make mbedtls_mpi_mont*() available") 2080a8c96a5d ("mbedtls: configure mbedtls to reach for config") e0858334327a ("mbedtls: remove default include/mbedtls/config.h") dd9688e6b8ce ("Import mbedtls-2.28.1")
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e27e865a | 28-Jun-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
pta: rng: rename rng_pta_client.h to pta_rng.h
Renames RNG PTA exported header file from rng_pta_client.h to pta_rng.h as the later follows PTAs header file name convention in optee_os that is pta_x
pta: rng: rename rng_pta_client.h to pta_rng.h
Renames RNG PTA exported header file from rng_pta_client.h to pta_rng.h as the later follows PTAs header file name convention in optee_os that is pta_xxx.h.
Preserve rng_pta_client.h for backward compatibility. That header file only includes pta_rng.h.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e906cbe7 | 28-Mar-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
libutils: Import strtok_r() from newlib
Import strtok_r() from newlib.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jer
libutils: Import strtok_r() from newlib
Import strtok_r() from newlib.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ad0ae800 | 27-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
riscv: create makefiles and directories tree for riscv
This commits creates the very first makefiles, directories and subdirectories for RISC-V port. It also creates a new platform flavor named plat
riscv: create makefiles and directories tree for riscv
This commits creates the very first makefiles, directories and subdirectories for RISC-V port. It also creates a new platform flavor named plat-spike. Spike is a reference functional RISC-V ISA simulator which provides full system emulation and it is developed alongside the RISC-V toolchain.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 3f61056d | 06-May-2022 |
Sohaib ul Hassan <sohaib.ul.hassan@unikie.com> |
libutee: add X25519 support
This commit adds X25519 support to libutee as defined in TEE Internal Core API v1.2.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier
libutee: add X25519 support
This commit adds X25519 support to libutee as defined in TEE Internal Core API v1.2.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Sohaib ul Hassan <sohaib.ul.hassan@unikie.com> [jf: minor edit to commit description] Signed-off-by: Jerome Forissier <jerone.forissier@linaro.org>
show more ...
|
| 52199c35 | 28-May-2022 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
core: dt_driver: Add support for disabled devices
In systems where there are multiple instances of the devices like two TRNGs where one is reserved for REE environment and one is for TEE environment
core: dt_driver: Add support for disabled devices
In systems where there are multiple instances of the devices like two TRNGs where one is reserved for REE environment and one is for TEE environment those can be defined in device tree in following way:
ree-trng { status = "okay"; secure-status = "disabled"; ... }
tee-trng { status = "disabled"; secure-status = "okay"; ... }
If OP-TEE has driver enabled for the device both devices will be probed.
Driver can detect device's 'status' and 'secure-status' settings and return TEE_ERROR_NODE_DISABLED value for one that is not for its use.
This will indicate to device driver probing to continue without an error.
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8ea50d3b | 20-Apr-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: pta: scmi: new API to support MSG header communication protocol
in the SCMI PTA. Adds a new capability and a new command to the SCMI PTA API to support SCMI MSG header communication protocol.
core: pta: scmi: new API to support MSG header communication protocol
in the SCMI PTA. Adds a new capability and a new command to the SCMI PTA API to support SCMI MSG header communication protocol. Capability PTA_SCMI_CAPS_MSG_HEADER allows client and service to negotiate the desired transport configuration. Command PTA_SCMI_CMD_PROCESS_MSG_CHANNEL allows client to request processing of a message sent based on that message exchange protocol where input and output SCMI messages are exchange using OP-TEE shared memory references provided by the client.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|