| 7540cb75 | 27-Apr-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: confine_array_index: fix clang build trace for Thumb2
Avoid trace 'deprecated instruction in IT block [-Werror,-Winline-asm]' when building with CLang. The message states performance issue
libutils: confine_array_index: fix clang build trace for Thumb2
Avoid trace 'deprecated instruction in IT block [-Werror,-Winline-asm]' when building with CLang. The message states performance issue which is true but prefer the performance cost over the security flaw hence warning trace is removed without embedded code changed.
Fixes: 2b6dd0df52b4 ("confine_array_index.h: add A32 and T32 versions of confine_array_index()") Suggested-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c7c07720 | 25-Apr-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: confine_array_index: fix 32bit modes implementation
Fix implementation of confine_array_index() for 32bit Arm and Thumb2 modes as previous implementation did not set the return value expli
libutils: confine_array_index: fix 32bit modes implementation
Fix implementation of confine_array_index() for 32bit Arm and Thumb2 modes as previous implementation did not set the return value explicitly and relied on luck with the layout of the machine code to return the correct value.
Fixes: https://github.com/OP-TEE/optee_os/issues/3799 Fixes: 2b6dd0df52b4 ("confine_array_index.h: add A32 and T32 versions of confine_array_index()") Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (qemu,qemu_v8) Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 11fa71b9 | 20-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
Squashed commit upgrading to mbedtls-2.22.0
Squash merging branch import/mbedtls-2.22.0
5cab03377186 ("mk/clang.mk: define libgcc$(sm)") 3607a5386a72 ("core: mbedtls: enable MBEDTLS_ECDH_LEGACY_CON
Squashed commit upgrading to mbedtls-2.22.0
Squash merging branch import/mbedtls-2.22.0
5cab03377186 ("mk/clang.mk: define libgcc$(sm)") 3607a5386a72 ("core: mbedtls: enable MBEDTLS_ECDH_LEGACY_CONTEXT") 896c8845bbda ("mbedtls: remove file md_wrap.c from build") 400b2af54fa0 ("libmbedtls: mbedtls_mpi_exp_mod(): optimize mempool usage") 777827c7af3d ("libmbedtls: mbedtls_mpi_exp_mod(): reduce stack usage") 549e4600678e ("libmbedtls: preserve mempool usage on reinit") 02d636083fe2 ("libmbedtls: mbedtls_mpi_exp_mod() initialize W") d2ac2b3c92bf ("libmbedtls: fix no CRT issue") f550879d5be2 ("libmbedtls: add interfaces in mbedtls for context memory operation") 219173d807ce ("libmedtls: mpi_miller_rabin: increase count limit") 7930b0b6b5e4 ("libmbedtls: add mbedtls_mpi_init_mempool()") 78af9fdc120f ("libmbedtls: make mbedtls_mpi_mont*() available") 8f7357271cc2 ("libmbedtls: refine mbedtls license header") c5993878881f ("mbedtls: configure mbedtls to reach for config") 6f9c587783af ("mbedtls: remove default include/mbedtls/config.h") 3d3bd3b12752 ("Import mbedtls-2.22.0")
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 21282bae | 16-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: ECC: make sure key_size is consistent with attributes
TEE_GenerateKey() takes a key_size argument and various attributes. If the size derived from the attributes is not key_size, we sh
core: crypto: ECC: make sure key_size is consistent with attributes
TEE_GenerateKey() takes a key_size argument and various attributes. If the size derived from the attributes is not key_size, we should return TEE_ERROR_BAD_PARAMETERS as per the GP TEE Internal Core API specification v1.2.1: "If an incorrect or inconsistent attribute is detected. The checks that are performed depend on the implementation.".
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9f4dcefb | 16-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: DH: make sure key_size is consistent with attributes
TEE_GenerateKey() takes a key_size argument and various attributes. For Diffie-Hellman, if the size of the prime number (TEE_ATTR_D
core: crypto: DH: make sure key_size is consistent with attributes
TEE_GenerateKey() takes a key_size argument and various attributes. For Diffie-Hellman, if the size of the prime number (TEE_ATTR_DH_PRIME) is not key_size, we should return TEE_ERROR_BAD_PARAMETERS as per the GP TEE Internal Core API specification v1.2.1: "If an incorrect or inconsistent attribute is detected. The checks that are performed depend on the implementation.".
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b213d8bd | 08-Apr-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
pta: invoke_test.pta: add test on null memref parameter
Add command PTA_INVOKE_TESTS_CMD_MEMREF_NULL to test invocation of a PTA with a memref parameter with a NULL buffer reference. The PTA should
pta: invoke_test.pta: add test on null memref parameter
Add command PTA_INVOKE_TESTS_CMD_MEMREF_NULL to test invocation of a PTA with a memref parameter with a NULL buffer reference. The PTA should successfully be invoked with a valid memref parameter yet referring to a NULL buffer pointer.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Cedric Neveux <cedric.neveux@nxp.com>
show more ...
|
| 5b25c76a | 07-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
Squashed commit upgrading to mbedtls-2.16.5
Squash merging branch import/mbedtls-2.16.5
058aefb2bfa4 ("core: mbedtls: use SHA-256 crypto accelerated routines") bcef9baed8f1 ("core: mbedtls: use SHA
Squashed commit upgrading to mbedtls-2.16.5
Squash merging branch import/mbedtls-2.16.5
058aefb2bfa4 ("core: mbedtls: use SHA-256 crypto accelerated routines") bcef9baed8f1 ("core: mbedtls: use SHA-1 crypto accelerated routines") c9359f31db12 ("core: mbedtls: use AES crypto accelerated routines") 0e6c1e2642c7 ("core: merge tee_*_get_digest_size() into a single function") 0cb3c28a2f4d ("libmbedtls: mbedtls_mpi_exp_mod(): optimize mempool usage") 5abf0e6ab72e ("libmbedtls: mbedtls_mpi_exp_mod(): reduce stack usage") 2ccc08ac7fef ("libmbedtls: preserve mempool usage on reinit") cd2a24648569 ("libmbedtls: mbedtls_mpi_exp_mod() initialize W") 7727182ecb56 ("libmbedtls: fix no CRT issue") 120737075dcf ("libmbedtls: add interfaces in mbedtls for context memory operation") 1126250b3af8 ("libmbedtls: add missing source file chachapoly.c") 23972e9f1c98 ("libmedtls: mpi_miller_rabin: increase count limit") 1fcbc05b3cd2 ("libmbedtls: add mbedtls_mpi_init_mempool()") 66e03f068078 ("libmbedtls: make mbedtls_mpi_mont*() available") d07e0ce56236 ("libmbedtls: refine mbedtls license header") 491ee2cd0ff4 ("mbedtls: configure mbedtls to reach for config") 9b6cee685d9a ("mbedtls: remove default include/mbedtls/config.h") 84f7467a0a91 ("Import mbedtls-2.16.5")
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5b2aaa11 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: optimize memcpy() for speed
Overrides the -Os flag with -O2 in order to compile a speed optimized version of memcpy().
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-b
libutee: optimize memcpy() for speed
Overrides the -Os flag with -O2 in order to compile a speed optimized version of memcpy().
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2fc5dc95 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mbedtls: use SHA-256 crypto accelerated routines
Uses the recently provided accelerated SHA-256 routine.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander
core: mbedtls: use SHA-256 crypto accelerated routines
Uses the recently provided accelerated SHA-256 routine.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 734545da | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mbedtls: use SHA-1 crypto accelerated routines
Uses the recently provided accelerated SHA-1 routine.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <je
core: mbedtls: use SHA-1 crypto accelerated routines
Uses the recently provided accelerated SHA-1 routine.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 10b90791 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mbedtls: use AES crypto accelerated routines
Uses the recently provided accelerated AES crypto routines in mbedtls.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jen
core: mbedtls: use AES crypto accelerated routines
Uses the recently provided accelerated AES crypto routines in mbedtls.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 85898338 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
pta: invoke_test.pta: add aes performance test
Adds test PTA function to run performance test with xtest --aes-perf.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wikland
pta: invoke_test.pta: add aes performance test
Adds test PTA function to run performance test with xtest --aes-perf.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7acaf5ad | 01-Apr-2020 |
Albert Schwarzkopf <a.schwarzkopf@phytec.de> |
libutee: Remove ae_tag_len from __TEE_OperationHandle
Remove ae_tag_len from __TEE_OperationHandle structure, since that information is available in the TEE_OperationInfo.digestLength field.
Signed
libutee: Remove ae_tag_len from __TEE_OperationHandle
Remove ae_tag_len from __TEE_OperationHandle structure, since that information is available in the TEE_OperationInfo.digestLength field.
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 7c767434 | 02-Apr-2020 |
Albert Schwarzkopf <a.schwarzkopf@phytec.de> |
core: merge tee_*_get_digest_size() into a single function
Rename tee_hash_get_digest_size() to tee_alg_get_digest_size().
Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGE
core: merge tee_*_get_digest_size() into a single function
Rename tee_hash_get_digest_size() to tee_alg_get_digest_size().
Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGEST_SIZE.
Remove tee_mac_get_digest_size() as its functionality is handled by tee_alg_get_digest_size() now.
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2e5e6460 | 02-Apr-2020 |
Albert Schwarzkopf <a.schwarzkopf@phytec.de> |
libutee: Set digestLength value in TEE_OperationInfo structure
Set digestLength as specified in TEE Internal Core API, section 6.2.3.
Introduce a new macro TEE_ALG_GET_DIGEST_SIZE() to utee_defines
libutee: Set digestLength value in TEE_OperationInfo structure
Set digestLength as specified in TEE Internal Core API, section 6.2.3.
Introduce a new macro TEE_ALG_GET_DIGEST_SIZE() to utee_defines.h, combining the implementation of tee_hash_get_digest_size() and tee_mac_get_digest_size()
Fixes: https://github.com/OP-TEE/optee_os/issues/3471
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a31e8303 | 01-Apr-2020 |
Jerome Forissier <jerome@forissier.org> |
Remove '.section .text.<name>' and use function macros instead
Assembler functions are normally defined using the FUNC/LOCAL_FUNC macros from <asm.S>. The macros takes care of several things, includ
Remove '.section .text.<name>' and use function macros instead
Assembler functions are normally defined using the FUNC/LOCAL_FUNC macros from <asm.S>. The macros takes care of several things, including putting the function in a specific section for later garbage collection by the linker (--gc-sections).
A few files do not follow this convention, let's fix them. Two functions in ghash-ce-core_a64.S (pmull_gcm_load_round_keys() and pmull_gcm_aes_sub()) totally lack a .section directive, which I think is a mistake. Fix them at the same time.
No functional change is expected.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 78f462f6 | 23-Mar-2020 |
Sumit Garg <sumit.garg@linaro.org> |
core: add TEE_LOGIN_REE_KERNEL login method
Add private login method for REE kernel clients to invoke TAs. It allows a TA to distinguish among normal world clients whether its a REE kernel client or
core: add TEE_LOGIN_REE_KERNEL login method
Add private login method for REE kernel clients to invoke TAs. It allows a TA to distinguish among normal world clients whether its a REE kernel client or a REE user-space client.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| a73ebd47 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
util.h: add ROUNDUP_DIV(x, y) macro
Adds the ROUNDUP_DIV(x, y) macro which Rounds up to the nearest multiple of y and then divides by y. Safe against overflow, y has to be a multiple of 2 just as in
util.h: add ROUNDUP_DIV(x, y) macro
Adds the ROUNDUP_DIV(x, y) macro which Rounds up to the nearest multiple of y and then divides by y. Safe against overflow, y has to be a multiple of 2 just as in the other two ROUNDUP*() macros.
This macro is intended to be used to convert from "number of bytes" to "number of pages" or similar units. Example: num_pages = ROUNDUP_DIV(num_bytes, SMALL_PAGE_SIZE);
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 70ed8fd5 | 06-Mar-2020 |
Jerome Forissier <jerome@forissier.org> |
libutee: arm64: update register accessor macros to support Clang
When building a 64-bit TA that includes <arm64_user_sysreg.h>, Clang complains about ASM operand width:
lib/libutee/include/arm64_u
libutee: arm64: update register accessor macros to support Clang
When building a 64-bit TA that includes <arm64_user_sysreg.h>, Clang complains about ASM operand width:
lib/libutee/include/arm64_user_sysreg.h:31:1: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] DEFINE_REG_READ_FUNC_(cntfrq, uint32_t, cntfrq_el0) ^ lib/libutee/include/arm64_user_sysreg.h:20:42: note: expanded from macro 'DEFINE_REG_READ_FUNC_' asm volatile("mrs %0, " #asmreg : "=r" (val)); \ ^ lib/libutee/include/arm64_user_sysreg.h:31:1: note: use constraint modifier "w" lib/libutee/include/arm64_user_sysreg.h:20:20: note: expanded from macro 'DEFINE_REG_READ_FUNC_' asm volatile("mrs %0, " #asmreg : "=r" (val)); \ ^ Let's apply the same fix as in commit 16e2153c57f0 ("core: arm64: update register accessor macros to support Clang").
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f88850d4 | 11-Mar-2020 |
Jerome Forissier <jerome@forissier.org> |
libutils: add __noreturn to longjmp() prototype
The longjmp() function does not return, therefore it should have the __noreturn attribute. Avoids compiler warnings.
Signed-off-by: Jerome Forissier
libutils: add __noreturn to longjmp() prototype
The longjmp() function does not return, therefore it should have the __noreturn attribute. Avoids compiler warnings.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2b6dd0df | 03-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
confine_array_index.h: add A32 and T32 versions of confine_array_index()
Adds inline assembly implementations for the A32 and T32 instruction sets. The implementation is based on __load_no_speculate
confine_array_index.h: add A32 and T32 versions of confine_array_index()
Adds inline assembly implementations for the A32 and T32 instruction sets. The implementation is based on __load_no_speculate1() in <speculation_barrier.h>.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6b40e452 | 03-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: import confine_array_index.h from Fuchsia
Imports confine_array_index.h from [1].
Replaced include statements to suit OP-TEE and removed the namespace directive. Added content from [2] as
libutils: import confine_array_index.h from Fuchsia
Imports confine_array_index.h from [1].
Replaced include statements to suit OP-TEE and removed the namespace directive. Added content from [2] as a comment to clarify the license.
The speculation safe function confine_array_index() is provided with this.
Note that only AArch64 and x86_64 versions of the function is implemented in this commit.
Link: [1] https://fuchsia.googlesource.com/fuchsia/+/39d9b8c2dbb0f6133a835676f8f669b07aca6b30/zircon/system/ulib/fbl/include/fbl/confine_array_index.h Link: [2] https://fuchsia.googlesource.com/fuchsia/+/39d9b8c2dbb0f6133a835676f8f669b07aca6b30/LICENSE
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dd655cb9 | 14-Feb-2020 |
Jerome Forissier <jerome@forissier.org> |
ldelf, ta: add support for DT_INIT_ARRAY and DT_FINI_ARRAY
Adds support for running initialization and finalization functions in TA ELF files. Such functions are used, for instance, by C++ compilers
ldelf, ta: add support for DT_INIT_ARRAY and DT_FINI_ARRAY
Adds support for running initialization and finalization functions in TA ELF files. Such functions are used, for instance, by C++ compilers to construct and destruct global objects. They can also be used in C thanks to __attribute__((constructor)) and __attribute__((destructor)).
A global structure is added to libutee. ldelf is responsible for filling it with the addresses of the functions pointer arrays present in the ELF files whenever such a file is loaded. Since the number of arrays is unknown at compile time (it depends on how many ELF files are loaded, and whether they have constructors or destructors), memory is allocated on the TA heap.
Two helper functions are introduced: __utee_call_elf_init_fn() and __utee_call_elf_fini_fn(). They are used when the TA instance is created and torn down, as well as by dlopen().
Signed-off-by: Jerome Forissier <jerome@forissier.org> Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, QEMUv8, HiKey960 32/64) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ca171ad2 | 18-Feb-2020 |
Jerome Forissier <jerome@forissier.org> |
libutee: remove utee_misc.h and utee_misc.c
utee_misc.{h,c} contain an unused function: utee_get_ta_exec_id(), and nothing else. Remove them.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
libutee: remove utee_misc.h and utee_misc.c
utee_misc.{h,c} contain an unused function: utee_get_ta_exec_id(), and nothing else. Remove them.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dd333f03 | 20-Jan-2020 |
Javier Almansa Sobrino <javier.almansasobrino@arm.com> |
core: Add support to access a TPM event log in secure memory.
Support for OPTEE to be able to receive a TPM event log through a DTB so it can forward it to a TA (such as a TPM service) in order to e
core: Add support to access a TPM event log in secure memory.
Support for OPTEE to be able to receive a TPM event log through a DTB so it can forward it to a TA (such as a TPM service) in order to extend the measurements.
CFG_CORE_TPM_EVENT_LOG enables this feature. CFG_TPM_LOG_BASE_ADDR hardcodes the phys address of the event log in case CFG_DT is not set. CFG_TPM_MAX_LOG_SIZE harcodes the size of the event log in case CFG_DT is not set.
When this feature is enabled, the PTA_SYSTEM_GET_TPM_EVENT_LOG command is available to any TA.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|