| 7ae15736 | 18-Jun-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ree_fs: fix dirfile handle refcount
The counter ree_fs_dirh_refcount is used to determine when ree_fs_dirh should be free, not as a guarantee that ree_fs_dirh is still valid. This wasn't the a
core: ree_fs: fix dirfile handle refcount
The counter ree_fs_dirh_refcount is used to determine when ree_fs_dirh should be free, not as a guarantee that ree_fs_dirh is still valid. This wasn't the assumption in ree_fs_readdir_rpc(), ree_fs_closedir_rpc(), and ree_fs_opendir_rpc(). So fix that by using get_dirh() in ree_fs_readdir_rpc as needed.
Reported-by: Gavin Liu <gavin.liu@mediatek.com> Closes: https://github.com/OP-TEE/optee_os/issues/6895 Fixes: ace6039fd434 ("core: REE_FS: refcount dirfile handle") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 68ac62ef | 03-Apr-2024 |
Sami Tolvanen <samitolvanen@google.com> |
core: add CFG_RSA_PUB_EXPONENT_3
When generating RSA key pairs, OP-TEE currently enforces a minimum public exponent size of 65537 per NIST SP800-56B recommendations. However, AOSP KeyMint VTS (Encry
core: add CFG_RSA_PUB_EXPONENT_3
When generating RSA key pairs, OP-TEE currently enforces a minimum public exponent size of 65537 per NIST SP800-56B recommendations. However, AOSP KeyMint VTS (EncryptionOperationsTest.RsaNoPaddingSuccess [1]) requires implementations to support public exponent 3 for backwards compatibility. Add CFG_RSA_PUB_EXPONENT_3 to allow public exponents >= 3.
Link: https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/main/security/keymint/aidl/vts/functional/KeyMintTest.cpp#5258 [1] Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 59fea683 | 16-Jan-2024 |
Igor Opaniuk <igor.opaniuk@foundries.io> |
core: pta: drop benchmark
Drop Benchmark PTA as current implementation is non-function and obsolete, and it's not supported anymore.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: E
core: pta: drop benchmark
Drop Benchmark PTA as current implementation is non-function and obsolete, and it's not supported anymore.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
show more ...
|
| 239fae35 | 08-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: tee: initialize dirfile|tadb_entry objects
Coverity reports many errors where dirfile_entry{} and tadb_entry{} objects are used un-initialized. Resolve these errors by setting these objects to
core: tee: initialize dirfile|tadb_entry objects
Coverity reports many errors where dirfile_entry{} and tadb_entry{} objects are used un-initialized. Resolve these errors by setting these objects to zero on declaration.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 2cc2a44c | 05-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: check if binary to bignum conversion succeed
Check return value of crypto_bignum_bin2bn().
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier
core: check if binary to bignum conversion succeed
Check return value of crypto_bignum_bin2bn().
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5ca2c365 | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| e92de4ca | 06-Dec-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: rpmb: cleanup useless write_counter in struct rpmb_fat_entry
The write_counter field of the rpmb_fat_entry struct is set from the RPMB device but never used. Rename it to 'unused' and cleanup
core: rpmb: cleanup useless write_counter in struct rpmb_fat_entry
The write_counter field of the rpmb_fat_entry struct is set from the RPMB device but never used. Rename it to 'unused' and cleanup the associated code.
Tested on QEMUv8 with:
$ make CFG_RPMB_FS=y CFG_RPMB_WRITE_KEY=y CFG_RPMB_TESKEY=y check
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Tested-by: Etienne Carriere <etienne.carriere@foss.st.com> (stm32mp157c-ev1 w/ RPMB)
show more ...
|
| 0f50ba5a | 28-Nov-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix objectUsage handling for persistent objects
Before this patch was the object usage field stored in the non-persistent part of an object handle, regardless of whether the storage object was
core: fix objectUsage handling for persistent objects
Before this patch was the object usage field stored in the non-persistent part of an object handle, regardless of whether the storage object was persistent. This prevents updates to this field from being restored the next time the persistent object is opened. Updates to the field are also not replicated to eventual other open handles for the object. Fix this by storing the "usage" bits in a new obj_info_usage field in struct tee_pobj for persistent objects. Updates to the field are also written into secure storage to preserve the content the next time the object is opened.
Fixes: b01047730e77 ("Open-source the TEE Core") Closes: https://github.com/OP-TEE/optee_os/issues/6495 Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 45279642 | 19-Oct-2023 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
core: tee_svc.c: allow to pass non-NULL memref of size 0
Allow TAs to pass non-NULL memref of size zero to other TAs by changing the non-NULL pointer into a NULL one in such a case. GP TEE Internal
core: tee_svc.c: allow to pass non-NULL memref of size 0
Allow TAs to pass non-NULL memref of size zero to other TAs by changing the non-NULL pointer into a NULL one in such a case. GP TEE Internal Core API does not forbid such memref parameter [1] whereas the previous implementation generated a TEE_ERROR_BAD_PARAMETERS error code when converting such memref buffer pointer into a physical memory address.
This change is specifically needed to allow a TA to forward a REE client memref for which GP TEE Client API explicitly allows such non-NULL address zero sized memref [2]. It also makes the TA implementation more flexible when dealing with its own memref.
[1] TEE Internal Core API Specification – Public Release v1.3.1, §4.9.4 "Operation Parameters in the Internal Client API" Table 4-15: "Interpretation of params[i] on Entry to Internal Client API"
[2] TEE Client API Specification v1.0, §4.5.4 TEEC_RegisterSharedMemory, paragraph "Implementers' Notes"
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 9ea709a7 | 14-Nov-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
tree wide: CFG_INSECURE deprecates CFG_WARN_INSECURE
Replaces configuration switch CFG_WARN_INSECURE with CFG_INSECURE The new name is better because the switch not only warns but also change the OP
tree wide: CFG_INSECURE deprecates CFG_WARN_INSECURE
Replaces configuration switch CFG_WARN_INSECURE with CFG_INSECURE The new name is better because the switch not only warns but also change the OP-TEE core behavior as, for example, allowing absence of secure storage rollback protection.
Suggested-by: Jérôme Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 1e9c1b80 | 05-May-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove temp memory allocation for TA invoke
Remove the temporary memory allocation used if a TA invokes another TA with a private memory buffer. This has not been in used with TAs compiled sin
core: remove temp memory allocation for TA invoke
Remove the temporary memory allocation used if a TA invokes another TA with a private memory buffer. This has not been in used with TAs compiled since commit ef305e54eac8 ("libutee: allocate temp secmem for invoke") or OP-TEE version 3.6.0.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 623b9bd4 | 23-Aug-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: use monotonic counter for secure storage without RPMB
If OP-TEE is configured without RPMB (CFG_REE_FS_INTEGRITY_RPMB=n), use the non-volatile monotonic counter interface instead to protect ag
core: use monotonic counter for secure storage without RPMB
If OP-TEE is configured without RPMB (CFG_REE_FS_INTEGRITY_RPMB=n), use the non-volatile monotonic counter interface instead to protect against rollback of the REE FS base secure storage.
If configured without CFG_WARN_INSECURE=y, accept TEE_ERROR_NOT_IMPLEMENTED error from nv_counter_get_ree_fs() and nv_counter_incr_ree_fs_to() and warn once to make clear that the configuration isn't secure.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Tested-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| aae97333 | 02-Aug-2023 |
loubaihui <loubaihui1@huawei.com> |
crypto: introduce CFG_CRYPTO_HW_PBKDF2
Add a new configuration flag to support hardware implementation of PBKDF2.
Signed-off-by: loubaihui <loubaihui1@huawei.com> Acked-by: Jens Wiklander <jens.wik
crypto: introduce CFG_CRYPTO_HW_PBKDF2
Add a new configuration flag to support hardware implementation of PBKDF2.
Signed-off-by: loubaihui <loubaihui1@huawei.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 7be18e1b | 06-Sep-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: simplify calls to bb_memdup_user_private()
Now that bb_memdup_user_private() supports supplying zero-lenth buffers remove checks for zero-length buffer before calling bb_memdup_user_private().
core: simplify calls to bb_memdup_user_private()
Now that bb_memdup_user_private() supports supplying zero-lenth buffers remove checks for zero-length buffer before calling bb_memdup_user_private().
Removes calls to memtag_strip_tag() for input buffer to bb_memdup_user_private() since that's also dealt with internally by that function.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| c6a1b33b | 06-Sep-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: simplify utee_param_to_param() with BB_MEMDUP_USER()
Simplifies utee_param_to_param() by using BB_MEMDUP_USER() instead of bb_alloc() followed by copy_from_user().
Signed-off-by: Jens Wikland
core: simplify utee_param_to_param() with BB_MEMDUP_USER()
Simplifies utee_param_to_param() by using BB_MEMDUP_USER() instead of bb_alloc() followed by copy_from_user().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| f5348ecb | 25-Aug-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: tee_svc_cryp.c: replace get_used_bits()
Prior to this patch was get_used_bits() called in tee_svc_cryp_obj_populate_type() to check that a bignum isn't too large. While the code works it's mor
core: tee_svc_cryp.c: replace get_used_bits()
Prior to this patch was get_used_bits() called in tee_svc_cryp_obj_populate_type() to check that a bignum isn't too large. While the code works it's more complicated than necessary. The bignum has just been imported so the normal bignum functions can be used directly instead of copying the user space buffer again and feed it to bit_ffs(). So replace the call to get_used_bits() with a call to crypto_bignum_num_bits() on the newly imported bignum.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ef44161f | 25-Aug-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: update ts_store API with user space buffer
Updates the read() function pointer in struct ts_store_ops to take an user space buffer in addition to the previous core buffer. Core buffers are nor
core: update ts_store API with user space buffer
Updates the read() function pointer in struct ts_store_ops to take an user space buffer in addition to the previous core buffer. Core buffers are normal secure memory while user space buffers should only be accessed using the user_access.h functions.
The different TA storage implementations are updated accordingly.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| d24c41ef | 22-Aug-2023 |
Clement Faure <clement.faure@nxp.com> |
core: tee: initialize variables in entry_open_session()
Initialize local variables at declaration as specified by the coding guidelines.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewe
core: tee: initialize variables in entry_open_session()
Initialize local variables at declaration as specified by the coding guidelines.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a4ba53eb | 24-Jul-2023 |
Clement Faure <clement.faure@nxp.com> |
core: tee: initialize dirfile_entry objects
Coverity reports many errors where dirfile_entry{} is used un-initialized. Resolve these errors by setting these objects to zero on declaration.
Signed-o
core: tee: initialize dirfile_entry objects
Coverity reports many errors where dirfile_entry{} is used un-initialized. Resolve these errors by setting these objects to zero on declaration.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 85a3e2d5 | 24-Jul-2023 |
Clement Faure <clement.faure@nxp.com> |
core: tee: entry_open_session(): initialize tee_ta_param object
Initialize tee_ta_param{} to zero in entry_open_session() so it can be used initialized in cleanup_shm_refs() without Coverity error.
core: tee: entry_open_session(): initialize tee_ta_param object
Initialize tee_ta_param{} to zero in entry_open_session() so it can be used initialized in cleanup_shm_refs() without Coverity error.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b2284b11 | 17-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: update FS storage API with user space buffer
Updates the create(), read(), and write() function pointers in struct ts_store_ops to take a user space buffer in addition to the previous core buf
core: update FS storage API with user space buffer
Updates the create(), read(), and write() function pointers in struct ts_store_ops to take a user space buffer in addition to the previous core buffer. Core buffers are normal secure memory while user space buffers should only be accessed using the user_access.h functions.
The different FS storage implementations are updated accordingly.
Note that the RPMB FS storage implementation resorts to using enter_user_access() and exit_user_access() due to internal complexities.
Fixes: 4e154320e47c ("core: Apply finer-grained PAN") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 6d628a81 | 17-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_storage_obj_rename(): fix direct user memory access
Fixes a direct user memory access in syscall_storage_obj_rename() which can lead to a data abort if PAN is enabled.
Fixes: 84f78978
core: syscall_storage_obj_rename(): fix direct user memory access
Fixes a direct user memory access in syscall_storage_obj_rename() which can lead to a data abort if PAN is enabled.
Fixes: 84f78978974b ("core: use user-access functions for storage svc") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 090e9463 | 17-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: pta: socket: fix direct user memory access
Replaces direct user memory accesses in the socket PTA with copy_to_user() and copy_from_user(). This avoids PAN errors when PAN is active.
Fixes: 4
core: pta: socket: fix direct user memory access
Replaces direct user memory accesses in the socket PTA with copy_to_user() and copy_from_user(). This avoids PAN errors when PAN is active.
Fixes: 4e154320e47c ("core: Apply finer-grained PAN") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| eb4a988a | 14-Jul-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add user buffer to tee_invoke_supp_plugin_rpc()
Adds a user buffer to tee_invoke_supp_plugin_rpc() so direct user memory access can be used when called with a buffer in user memory instead of
core: add user buffer to tee_invoke_supp_plugin_rpc()
Adds a user buffer to tee_invoke_supp_plugin_rpc() so direct user memory access can be used when called with a buffer in user memory instead of core memory. tee_invoke_supp_plugin_rpc() can still take a core memory buffer as an argument if needed.
PTA_SYSTEM_SUPP_PLUGIN_INVOKE in the system PTA is updated to pass the memref as a user memory buffer instead of a core memory buffer.
This fixes a direct privileged memory access to user space memory.
Fixes: 4e154320e47c ("core: Apply finer-grained PAN") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 34ce35b1 | 14-Jul-2023 |
loubaihui <loubaihui1@huawei.com> |
crypto: add X448 support
Refer to the X25519 algorithm, add the X448 algorithm framework code.
Signed-off-by: loubaihui <loubaihui1@huawei.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.o
crypto: add X448 support
Refer to the X25519 algorithm, add the X448 algorithm framework code.
Signed-off-by: loubaihui <loubaihui1@huawei.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|