| cbe7e1b8 | 11-Dec-2020 |
Balint Dobszay <balint.dobszay@arm.com> |
core: extract ldelf related code from system PTA
Various functions in the system PTA are only used in conjunction with ldelf. They either implement a system service needed only by ldelf (system_open
core: extract ldelf related code from system PTA
Various functions in the system PTA are only used in conjunction with ldelf. They either implement a system service needed only by ldelf (system_open_ta_binary(), etc.) or they provide an interface for TAs to invoke services implemented in user space by ldelf (call_ldelf_dlopen(), call_ldelf_dlsym()). Extract these to a separate file as a first step towards converting the PTA system_*() calls into proper ldelf-specific syscalls.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
show more ...
|
| 9c34c0c7 | 11-Dec-2020 |
Balint Dobszay <balint.dobszay@arm.com> |
core: prefer struct user_mode_ctx in system PTA
Most functions in system PTA have struct ts_session as parameter, but only use it for getting the pointer to user_mode_ctx. This commit simplifies the
core: prefer struct user_mode_ctx in system PTA
Most functions in system PTA have struct ts_session as parameter, but only use it for getting the pointer to user_mode_ctx. This commit simplifies the code by doing the casting in a single place and passing user_mode_ctx as an argument instead.
This also eliminates casting to user_ta_ctx as an intermediate step. It is a preparation step for extracting ldelf related functions from system PTA to an ldelf specific syscall handler.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
show more ...
|
| 3f286c3b | 28-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Reintroduce memalign() and friends
memalign() and friends where removed with the commit 8cd8a6296974 ("Remove memalign()").
At the time memalign() was unused and a bit buggy. This new memalign() is
Reintroduce memalign() and friends
memalign() and friends where removed with the commit 8cd8a6296974 ("Remove memalign()").
At the time memalign() was unused and a bit buggy. This new memalign() is believed to work correctly due to extensive testing. Recently memalign() has been needed by certain drivers so it makes sense to add it again.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cb1b1ecd | 25-Aug-2020 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: pta: SCP03 pseudo trusted application
Implement GlobalPlatform Secure Channel Protocol 3 control from REE. Secure boot requires that SCP03 is enabled as soon as secure storage is available (ie
core: pta: SCP03 pseudo trusted application
Implement GlobalPlatform Secure Channel Protocol 3 control from REE. Secure boot requires that SCP03 is enabled as soon as secure storage is available (ie RPMB).
Host side example: github.com/foundriesio/optee-scp03
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e3603bde | 27-Oct-2020 |
Balint Dobszay <balint.dobszay@arm.com> |
core: move non TA specific fields from user_ta_ctx
Moves fields from user_ta_ctx to user_mode_ctx, which are not specific to user TAs. This is needed to prepare for handling Secure Partitions, user_
core: move non TA specific fields from user_ta_ctx
Moves fields from user_ta_ctx to user_mode_ctx, which are not specific to user TAs. This is needed to prepare for handling Secure Partitions, user_mode_ctx will be the common ground for the fields used by both TAs and SPs.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
show more ...
|
| 880d8d8e | 06-Oct-2020 |
Jelle Sels <jelle.sels@arm.com> |
core: create embedded_ts
Create an embedded ts struct which will encapsulate both early_ta's and embedded SPs.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Reviewed-by: Jens Wiklander <jens.wikla
core: create embedded_ts
Create an embedded ts struct which will encapsulate both early_ta's and embedded SPs.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 6cb02818 | 05-Oct-2020 |
Jelle Sels <jelle.sels@arm.com> |
core: rename ta_store to ts_store
Rename the ta_store to the ts_store. We will need the stores to load SPs (secure partitions). By renaming ta_store to ts_store (trusted service) we indicate that th
core: rename ta_store to ts_store
Rename the ta_store to the ts_store. We will need the stores to load SPs (secure partitions). By renaming ta_store to ts_store (trusted service) we indicate that the stores are not only used by the TAs but that they can also be used by SPs.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 89c9728d | 19-Oct-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: replace tee_mmu prefix with vm
Replaces the tee_mmu prefix with vm. tee_mmu.h is renamed to vm.h and core/arch/arm/mm/tee_mmu.c is moved to core/mm/vm.c. Public functions belonging to these fi
core: replace tee_mmu prefix with vm
Replaces the tee_mmu prefix with vm. tee_mmu.h is renamed to vm.h and core/arch/arm/mm/tee_mmu.c is moved to core/mm/vm.c. Public functions belonging to these files are renamed with a vm prefix.
Introduces: vm_map_param(), vm_clean_param(), vm_buf_is_inside_private(), vm_buf_intersects_private(), vm_buf_to_mboj_offs(), vm_buf_is_inside_um_private(), vm_buf_intersects_um_private(), vm_add_rwmem(), vm_rem_rwmem(), vm_va2pa(), vm_pa2va(), vm_check_access_rights(), vm_set_ctx() replacing their tee_mmu_*() counterpart.
Acked-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 00b3b9a2 | 31-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct t
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct ts_session. All future sessions structs (currently only struct tee_ta_session exists) should add this struct to allow generic session operations.
With this struct comes new functions replacing previous struct tee_ta_session oriented functions. The following functions are replaced as: tee_ta_get_current_session() -> ts_get_current_session() tee_ta_push_current_session() -> ts_push_current_session() tee_ta_pop_current_session() -> ts_pop_current_session() tee_ta_get_calling_session() -> ts_get_calling_session()
ts_get_current_session() is changed compared to its predecessor to panic() in case of failure to return a valid pointer.
A new function ts_get_current_session_may_fail() is added to handle an eventual case where a return NULL session may be handled.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 919a5a68 | 06-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
Use fallthrough pseudo-keyword in switch/case statements
Use fallthrough; in switch/case statements. Imported libraries (libtomcrypt, libmbedtls) are not modified to minimize differences with upstre
Use fallthrough pseudo-keyword in switch/case statements
Use fallthrough; in switch/case statements. Imported libraries (libtomcrypt, libmbedtls) are not modified to minimize differences with upstream.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 918e36c6 | 03-Sep-2020 |
Sughosh Ganu <sughosh.ganu@linaro.org> |
core: Add a parameter to vm_map_pad() to specify alignment requirement
There are cases where the virtual address returned for a requested mapping needs to satisfy certain alignment requirements. All
core: Add a parameter to vm_map_pad() to specify alignment requirement
There are cases where the virtual address returned for a requested mapping needs to satisfy certain alignment requirements. Allow the calling functions to specify the required alignment as a parameter to vm_map_pad().
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bc5921cd | 05-May-2020 |
Maxim Uvarov <maxim.uvarov@linaro.org> |
core: device pta: add flag to indicate dependency on tee-supplicant
Some TAs require tee-supplicant to be run. For example fTPM requires storage services provided by tee-supplicant. When scanning an
core: device pta: add flag to indicate dependency on tee-supplicant
Some TAs require tee-supplicant to be run. For example fTPM requires storage services provided by tee-supplicant. When scanning and probe() devices on tee bus we can initialize early drivers which do not require tee-supplicant and after mount fs and tee-supplicant run do probe() drivers witch require tee-supplicant.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Suggested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3639b55f | 04-May-2020 |
Jerome Forissier <jerome@forissier.org> |
core: rename KEEP_INIT() and KEEP_PAGER()
The KEEP_INIT() and KEEP_PAGER() macros are quite often used in C files immediately after the definition of a function or a structure without a blank line i
core: rename KEEP_INIT() and KEEP_PAGER()
The KEEP_INIT() and KEEP_PAGER() macros are quite often used in C files immediately after the definition of a function or a structure without a blank line in between. This style mimics what the Linux kernel does for a similar use cases: EXPORT_SYMBOL().
Unfortunately, the checkpatch.pl tool expects a blank line after structure and function definitions, except for a few special cases such as EXPORT_SYMBOL(). As a result we often get unwanted warnings when we use KEEP_INIT() and KEEP_PAGER(). Among the exceptions are all words starting with DECLARE_ or DEFINE_, so by renaming our macros we could avoid the checkpatch warnings.
This commit renames KEEP_INIT() and KEEP_PAGER() to DECLARE_KEEP_INIT() and DECLARE_KEEP_PAGER(), respectively. The assembler macros are also renamed for consistency. No functional change is expected.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9389d803 | 01-Apr-2020 |
Maxim Uvarov <maxim.uvarov@linaro.org> |
core: device pta: enumerate early TAs
This is an extension of commit 0b611081804a ("core: pta: Add device pseudo TA") to register not only pseudo-TAs but also user-space early TAs that have the TA_F
core: device pta: enumerate early TAs
This is an extension of commit 0b611081804a ("core: pta: Add device pseudo TA") to register not only pseudo-TAs but also user-space early TAs that have the TA_FLAG_DEVICE_ENUM flag set.
This change makes enumerated early TAs visible on the optee bus in the Linux kernel.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> [jf: minor edits to descritpion, swap #include lines, s/(*pos)/*pos/] [jf: move local variable declaration up] Signed-off-by: Jerome Forissier <jerome@forissier.org> Tested-by: Maxim Uvarov <maxim.uvarov@linaro.org> (QEMU, ftpm) Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-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 ...
|
| 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 ...
|
| 095b07ce | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add overflow guard in system_unmap()
Adds an early overflow guard in system_unmap() against large va or sz values.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Foriss
core: add overflow guard in system_unmap()
Adds an early overflow guard in system_unmap() against large va or sz values.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a8e39e9c | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: wipe user data in system_derive_ta_unique_key()
Before system_derive_ta_unique_key() returns wipe the supplied user data from the heap as a precaution.
Reviewed-by: Joakim Bech <joakim.bech@l
core: wipe user data in system_derive_ta_unique_key()
Before system_derive_ta_unique_key() returns wipe the supplied user data from the heap as a precaution.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 18871ad0 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add overflow guard in system_set_prot()
Adds an early overflow guard in system_set_prot() against large va or sz values.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome
core: add overflow guard in system_set_prot()
Adds an early overflow guard in system_set_prot() against large va or sz values.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f19dd214 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix typo in system_set_prot()
Fixes a typo in system_set_prot() where a "," was used instead of a ";". This fix should not change the behaviour of the function.
Reviewed-by: Joakim Bech <joak
core: fix typo in system_set_prot()
Fixes a typo in system_set_prot() where a "," was used instead of a ";". This fix should not change the behaviour of the function.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4047f318 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix overflow in binh_copy_to()
Fixes overflows in binh_copy_to() when num_bytes or offs_bytes are very large numbers.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome For
core: fix overflow in binh_copy_to()
Fixes overflows in binh_copy_to() when num_bytes or offs_bytes are very large numbers.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1e4e976b | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix potential overflow in system_map_ta_binary()
Fixes potential overflows when calculating required sizes for mapping a part of a fobj.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Revi
core: fix potential overflow in system_map_ta_binary()
Fixes potential overflows when calculating required sizes for mapping a part of a fobj.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 908ce2d4 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix handle return in system_open_ta_binary()
Prior to this patch system_open_ta_binary() was not updating the params[0].value.a out parameter used to carry a handle of the opened binary. Fix t
core: fix handle return in system_open_ta_binary()
Prior to this patch system_open_ta_binary() was not updating the params[0].value.a out parameter used to carry a handle of the opened binary. Fix this by assigning the value to the handle to params[0].value.a.
Note that if only one binary is opened at a time the handle will be 0 and ldelf will still work even without this fix.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 787295df | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix potential overflow in system_map_zi()
Fixes a potential overflow when calculating required page size for a fobj allocation. This is fixed by using the new ROUNDUP_DIV() macro instead of ro
core: fix potential overflow in system_map_zi()
Fixes a potential overflow when calculating required page size for a fobj allocation. This is fixed by using the new ROUNDUP_DIV() macro instead of rounding up and the dividing.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c2020b9d | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: parameter check in system_rng_reseed()
Removes confusing comment in system_rng_reseed(). Removes the max limit on input buffer size, that's handled inside crypto_rng_add_event(). Also checks t
core: parameter check in system_rng_reseed()
Removes confusing comment in system_rng_reseed(). Removes the max limit on input buffer size, that's handled inside crypto_rng_add_event(). Also checks that the supplied buffer isn't NULL.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|