| 0adca93a | 04-Jan-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: dt_driver: differentiate error codes if property is not found
Differentiates error codes in dt_driver_device_from_node_idx_prop() if the requested resource is not found by returning TEE_ERROR_
core: dt_driver: differentiate error codes if property is not found
Differentiates error codes in dt_driver_device_from_node_idx_prop() if the requested resource is not found by returning TEE_ERROR_ITEM_NOT_FOUND. This is useful to differentiate cases for optional properties in drivers.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 683b6d2c | 03-Jan-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: kernel: move otp_stubs.c to core/kernel
otp_stubs.c is architecture-agnostic, therefore, move it from core/arch/arm/kernel to core/kernel.
Signed-off-by: Marouene Boubakri <marouene.boubakri@
core: kernel: move otp_stubs.c to core/kernel
otp_stubs.c is architecture-agnostic, therefore, move it from core/arch/arm/kernel to core/kernel.
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 ...
|
| c67c4c8d | 01-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: kernel: delay: sort-out architecture-independant code from arch dir
This commit moves core/arch/arm/kernel/delay.c to core/kernel/delay.c. Keeps architecture-dependant code in core/arch/$ARCH/
core: kernel: delay: sort-out architecture-independant code from arch dir
This commit moves core/arch/arm/kernel/delay.c to core/kernel/delay.c. Keeps architecture-dependant code in core/arch/$ARCH/include/kernel/delay_arch.h and moves generic functions to core/include/kernel/delay.h
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 14c0df4e | 01-Dec-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: move tee_time.c and tee_time_ree.c to core/kernel
tee_time.c and tee_time_ree.c are architecture-independant code therefore move them from core/arch/arm/kernel to core/kernel.
Signed-off-by:
core: move tee_time.c and tee_time_ree.c to core/kernel
tee_time.c and tee_time_ree.c are architecture-independant code therefore move them from core/arch/arm/kernel to core/kernel.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 33e931b1 | 23-Dec-2022 |
Mark-PK Tsai <mark-pk.tsai@mediatek.com> |
core: Correct the description of core_is_buffer_outside
Correct the function description of core_is_buffer_outside in comment.
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com> Reviewed-by: J
core: Correct the description of core_is_buffer_outside
Correct the function description of core_is_buffer_outside in comment.
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7b84e23d | 06-Dec-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
drivers: struct serial_ops: make all functions optional except putc()
Many platforms only use the putc() function pointer in struct serial_ops. Therefore, explicitly make the others optional (flush(
drivers: struct serial_ops: make all functions optional except putc()
Many platforms only use the putc() function pointer in struct serial_ops. Therefore, explicitly make the others optional (flush(), have_rx_data() and getchar()) by adding comments to the struct and making sure the code checks the pointer before using them.
With this it should be clear that drivers do not need to provide stub functions.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c123d804 | 29-Nov-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: embedded_ts: use mempool to decompress TS image
Changes embedded TS management to have zlib using default mempool to allocate buffers for image decompression. This is useful as the process can
core: embedded_ts: use mempool to decompress TS image
Changes embedded TS management to have zlib using default mempool to allocate buffers for image decompression. This is useful as the process can require buffer of several kilobytes.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5305bce1 | 08-Nov-2022 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: kernel: move trace_ext.c to core/kernel
Functions in trace_ext.c are architecture independent, therefore, code could be moved to core/kernel.
Signed-off-by: Marouene Boubakri <marouene.boubak
core: kernel: move trace_ext.c to core/kernel
Functions in trace_ext.c are architecture independent, therefore, code could be moved to core/kernel.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 2d7720f1 | 11-Nov-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add fault mitigations in ree_fs_ta_open()
Adds and enables fault mitigation in ree_fs_ta_open() to check the signature of the TA before returning success.
Acked-by: Jerome Forissier <jerome.f
core: add fault mitigations in ree_fs_ta_open()
Adds and enables fault mitigation in ree_fs_ta_open() to check the signature of the TA before returning success.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c8219657 | 01-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add fault mitigations in buf_ta_open()
Adds and enables fault mitigation in buf_ta_open() to check both the signature of the TA and then also the hash of the TA before returning success.
Acke
core: add fault mitigations in buf_ta_open()
Adds and enables fault mitigation in buf_ta_open() to check both the signature of the TA and then also the hash of the TA before returning success.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@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 ...
|
| 827c9002 | 10-Nov-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ree_fs: copy in encrypted TA header only once
In ree_fs_ta_open() when an encrypted TA is loaded there is an encrypted TA sub-header. Prior to this patch it was copied in from non-secure share
core: ree_fs: copy in encrypted TA header only once
In ree_fs_ta_open() when an encrypted TA is loaded there is an encrypted TA sub-header. Prior to this patch it was copied in from non-secure shared memory twice, first one time to read the total size of the header, and then a second time to copy in the entire header. Fix this by only copying in what wasn't copied the first time.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 19b1ce2b | 10-Nov-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ree_fs: check ta size before use
Check that the total loaded size of a TA matches what is in the sign header. This prevents an eventual attacker from providing arbitrary values in the img_size
core: ree_fs: check ta size before use
Check that the total loaded size of a TA matches what is in the sign header. This prevents an eventual attacker from providing arbitrary values in the img_size field of the signed header.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Suggested-by: Asaf Modelevsky <amodele@amazon.com> Reported-by: Asaf Modelevsky <amodele@amazon.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 884f2f1a | 21-Mar-2022 |
Olivier Moysan <olivier.moysan@foss.st.com> |
core: dt: allow null value in reg property
This change allows reg property to have value 0. The reg property can be used to describe an element that is not a physical address and for which 0 is a va
core: dt: allow null value in reg property
This change allows reg property to have value 0. The reg property can be used to describe an element that is not a physical address and for which 0 is a valid value.
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| c34d0d91 | 05-Sep-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: support loading TAs signed with a subkey
Adds support to load TAs signed with subkey or a chain of subkeys. This allows delegation of TA signing without distributing the root key. TAs signed w
core: support loading TAs signed with a subkey
Adds support to load TAs signed with subkey or a chain of subkeys. This allows delegation of TA signing without distributing the root key. TAs signed with a subkey are confined to the UUID-V5 namespace of the subkey to avoid TA UUID clashes with different subkeys.
SHDR_SUBKEY is a type of header which enables chains of public keys. The public root key is used to verify the first public subkey, which then is used to verify the next public subkey and so on.
The TA is finally verified using the last subkey. All these headers are added in front of the TA binary so everything needed to verify the TA is available when it's loaded into memory.
For example: Subkey struct shdr magic: 0x4f545348 img_type: 3 (SHDR_SUBKEY) img_size: 320 bytes algo: 0x70414930 (TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256) hash_size: 32 bytes sig_size: 256 bytes hash: f573f329fe77be686ce71647909c4ea35b5e1cd7de86369bd7d9fca31f6a4d65 struct shdr_subkey uuid: f04fa996-148a-453c-b037-1dcfbad120a6 name_size: 64 subkey_version: 1 max_depth: 4 algo: 0x70414930 (TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256) attr_count: 2 next name: "mid_level_subkey" Next header at offset: 692 (0x2b4) Subkey struct shdr magic: 0x4f545348 img_type: 3 (SHDR_SUBKEY) img_size: 320 bytes algo: 0x70414930 (TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256) hash_size: 32 bytes sig_size: 256 bytes hash: 233a6dcf1a2cf69e50cde8e20c4129157da707c76fa86ce12ee31037edef02d7 struct shdr_subkey uuid: 1a5948c5-1aa0-518c-86f4-be6f6a057b16 name_size: 64 subkey_version: 1 max_depth: 3 algo: 0x70414930 (TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256) attr_count: 2 next name: "subkey1_ta" Next header at offset: 1384 (0x568) Bootstrap TA struct shdr magic: 0x4f545348 img_type: 1 (SHDR_BOOTSTRAP_TA) img_size: 84576 bytes algo: 0x70414930 (TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256) hash_size: 32 bytes sig_size: 256 bytes hash: ea31ac7dc2cc06a9dc2853cd791dd00f784b5edc062ecfa274deeb66589b4ca5 struct shdr_bootstrap_ta uuid: 5c206987-16a3-59cc-ab0f-64b9cfc9e758 ta_version: 0 TA offset: 1712 (0x6b0) bytes TA size: 84576 (0x14a60) bytes
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_virt) Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ce20b8ec | 05-Sep-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ree_fs: refactor check_update_version()
Refactors check_update_version() to support more than one version database.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etien
core: ree_fs: refactor check_update_version()
Refactors check_update_version() to support more than one version database.
Reviewed-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 ...
|
| ec1aa4fa | 05-Sep-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add offset argument to shdr_alloc_and_copy()
Adds an offset argument to shdr_alloc_and_copy() to make it easier to copy a signed header located further into a non-secure buffer.
Reviewed-by:
core: add offset argument to shdr_alloc_and_copy()
Adds an offset argument to shdr_alloc_and_copy() to make it easier to copy a signed header located further into a non-secure buffer.
Reviewed-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 ...
|
| d2289450 | 24-Mar-2022 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
core: dt_driver: Add driver probing to use secure device tree
When secure external device tree is configured for use OP-TEE's drivers should be loaded based on its definitions. Add support to probe
core: dt_driver: Add driver probing to use secure device tree
When secure external device tree is configured for use OP-TEE's drivers should be loaded based on its definitions. Add support to probe drivers also with secure external device tree.
This allows common system device tree to be used to define devices for bootloaders and OP-TEE.
In any case if embedded device tree is defined this will take precedense.
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a5d5bbc8 | 25-Mar-2022 |
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> |
core: dt: Make it possible to alter device mapping
In case where IP core device is TrustZone aware and is used by both REE and TEE dt_map_dev() would normally cause non-secure mapping for the device
core: dt: Make it possible to alter device mapping
In case where IP core device is TrustZone aware and is used by both REE and TEE dt_map_dev() would normally cause non-secure mapping for the device.
When selected registers in IP core are only accessible by TrustZone device needs to be mapped with MEM_AREA_IO_SEC to cause actual AXI memory access be made with AWPROT[1] and ARPROT[1] bits configured properly.
This adds new argument for dt_map_dev() to enable forcing mapping to be secure or non-secure.
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4440385e | 09-Oct-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: ts_manager: remove unneeded check
The function ts_get_current_session() can not return NULL as panic() would abort the execution in that case.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundr
core: ts_manager: remove unneeded check
The function ts_get_current_session() can not return NULL as panic() would abort the execution in that case.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| b7acc3c9 | 08-Jun-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: call pgt_flush_ctx() from vm_info_final()
Moves the call to pgt_flush_ctx() into vm_info_final() from destroy_context() and tee_ta_init_user_ta_session().
Reviewed-by: Etienne Carriere <etien
core: call pgt_flush_ctx() from vm_info_final()
Moves the call to pgt_flush_ctx() into vm_info_final() from destroy_context() and tee_ta_init_user_ta_session().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f5154eb3 | 08-Jun-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: call tee_pager_rem_um_regions() from vm_info_final()
Moves the call to tee_pager_rem_um_regions() into vm_info_final() from free_utc() and stmm_ctx_destroy().
Reviewed-by: Etienne Carriere <e
core: call tee_pager_rem_um_regions() from vm_info_final()
Moves the call to tee_pager_rem_um_regions() into vm_info_final() from free_utc() and stmm_ctx_destroy().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e17e7a56 | 07-Jun-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move pgt_cache to struct user_mode_ctx
Moves pgt_cache from struct thread_specific_data to struct user_mode_ctx.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome F
core: move pgt_cache to struct user_mode_ctx
Moves pgt_cache from struct thread_specific_data to struct user_mode_ctx.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 60d3fc69 | 08-Jun-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: initialize struct user_mode_ctx with vm_info_init()
Broadens the scope of vm_info_init() to initialize the entire struct user_mode_ctx.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.
core: initialize struct user_mode_ctx with vm_info_init()
Broadens the scope of vm_info_init() to initialize the entire struct user_mode_ctx.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 93dc6b29 | 23-Sep-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add pointer authentication support
Previously pointer authentication was only supported for TAs. With this patch add a configuration option CFG_CORE_PAUTH to enable support for core. Each priv
core: add pointer authentication support
Previously pointer authentication was only supported for TAs. With this patch add a configuration option CFG_CORE_PAUTH to enable support for core. Each privileged thread has its own APIA key. There are also a separate APIA key for each physical core used when handling an abort or when using the tmp stack.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|