| 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 ...
|
| ede83d72 | 02-May-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: fix value of TEE_ECC_CURVE_SM2
The GlobalPlatform TEE Interbal Core API specification v1.3 has the following text:
In TEE Internal Core API v1.2 and v1.2.1, TEE_ECC_CURVE_25519 and TEE_E
libutee: fix value of TEE_ECC_CURVE_SM2
The GlobalPlatform TEE Interbal Core API specification v1.3 has the following text:
In TEE Internal Core API v1.2 and v1.2.1, TEE_ECC_CURVE_25519 and TEE_ECC_CURVE_SM2 were incorrectly assigned the same identifier.
Indeed, both were 0x00000300. In v1.3, TEE_ECC_CURVE_SM2 is now 0x00000400. Update the code accordingly.
This is an API and ABI change, but note that this value is used only in TEE_IsAlgorithmSupported(). Therefore, only TAs that dynamically check for algorithm support at runtime may be impacted. This change was tested on QEMUv8 by running "old" TAs (built without this commit) with a "newer" OP-TEE OS (including this commit), that is: - 'make run' and run 'xtest' - apply this change - 'make arm-tf && make run-only' and run 'xtest' again. No errors.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f21d4ead | 04-May-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: fix MTE error in realloc()
With memory tagging realloc() should only untag the old buffer if the allocation of a new buffer is successful.
The implementation of realloc() prior to this pa
libutils: fix MTE error in realloc()
With memory tagging realloc() should only untag the old buffer if the allocation of a new buffer is successful.
The implementation of realloc() prior to this patch is based on bgetr(). This is not so convenient with MTE enabled since the old buffer must be untagged before calling bgetr(). If realloc() fails the memory tags must be restored, but this was not done.
Restoring the tags is made somewhat more complicated by the fact that the size reported by bget_buf_size() may actually be larger than the size of the tagged buffer. Memalign() is sometimes forced to allocate buffers larger than requested in order to honor the requested alignment.
So instead of using bgetr(), realloc() is implemented using bget(), memcpy(), memset() and brel() as needed. This is the same thing that bgetr() did, except that the old buffer is not untagged until a new buffer has been successfully allocated.
Fixes: 08a5c4f9ae42 ("libutils: add MTE support in malloc() and friends") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a gp_20056) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 08a5c4f9 | 12-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add MTE support in malloc() and friends
Adds support for memory tagging using the hardware assisted Armv8.5-A Memory Tagging Extension in malloc() and friends.
When allocating memory the
libutils: add MTE support in malloc() and friends
Adds support for memory tagging using the hardware assisted Armv8.5-A Memory Tagging Extension in malloc() and friends.
When allocating memory the acquired memory range in tagged a special pointer with the tag coded in the top bits of the pointer. Accessing this memory without the coded tag will result in a Tag Check Exception.
MTE is enabled for both OP-TEE core and TAs at the same time with CFG_MEMTAG=y.
When the memory is freed it's untagged again. All accesses to heap memory using old/stale pointers will be caught. This is an efficient method to catch use-after-free and buffer overruns on the heap. The buffer overruns are limited in granularity to blocks of 16 bytes. However, the heap itself is also managed in blocks of 16 bytes so smaller buffer overruns will not damage the heap.
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 ...
|
| 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 ...
|
| 5cc08985 | 29-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: arm64: add read_dczid_el0()
Adds read_dczid_el0() to read Data Cache Zero ID register.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wikla
libutee: arm64: add read_dczid_el0()
Adds read_dczid_el0() to read Data Cache Zero ID register.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 466162e2 | 12-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor heap tagging
Refactors the heap tagging with CFG_CORE_SANITIZE_KADDRESS to use two new hooks maybe_tag_buf() and maybe_untag_buf().
maybe_tag_buf() is called from raw_malloc_retu
libutils: refactor heap tagging
Refactors the heap tagging with CFG_CORE_SANITIZE_KADDRESS to use two new hooks maybe_tag_buf() and maybe_untag_buf().
maybe_tag_buf() is called from raw_malloc_return_hook() which is called after bget(). maybe_untag_buf() is called before brel() is called.
This removes some of the local modifications to bget.c.
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 ...
|