| 3de8f0de | 25-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: helper for dependency on crypt service
Adds dt_driver_get_crypto() function to allow drivers to request probe deferral when depending on core crypto services. For that purpose tee_c
core: dt_driver: helper for dependency on crypt service
Adds dt_driver_get_crypto() function to allow drivers to request probe deferral when depending on core crypto services. For that purpose tee_cryp_init() is changed to call dt_driver_crypt_init_complete() once crypt layer initialization completes.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 34ab2802 | 29-Nov-2021 |
Jerome Forissier <jerome@forissier.org> |
core: move functions from tee_svc_storage.c to tee_rpmb_fs.c
tee_svc_storage_create_filename() and tee_svc_storage_create_dirname() are only used in core/tee/tee_rpmb_fs.c, so move them there and ma
core: move functions from tee_svc_storage.c to tee_rpmb_fs.c
tee_svc_storage_create_filename() and tee_svc_storage_create_dirname() are only used in core/tee/tee_rpmb_fs.c, so move them there and make them static. Since they now have file scope they may as well be given shorter names.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3b83f117 | 29-Nov-2021 |
Jerome Forissier <jerome@forissier.org> |
core: move FS files out of CFG_WITH_USER_TA
Some files which are currently guarded with CFG_WITH_USER_TA should be guarded with _CFG_WITH_SECURE_STORAGE or FS-specific configs (CFG_RPMB_FS, CFG_RPMB
core: move FS files out of CFG_WITH_USER_TA
Some files which are currently guarded with CFG_WITH_USER_TA should be guarded with _CFG_WITH_SECURE_STORAGE or FS-specific configs (CFG_RPMB_FS, CFG_RPMB_FS). This will allow the use of secure storage from kernel code when CFG_WITH_USER_TA=n.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c6b34ea8 | 29-Nov-2021 |
Jerome Forissier <jerome@forissier.org> |
core: fix build dependencies for fs_htree.c
core/tee/fs_htree.c is used when CFG_REE_FS=y, and is also used by the test PTA core/pta/tests/fs_htree.c. Rather than make the implementation depend on t
core: fix build dependencies for fs_htree.c
core/tee/fs_htree.c is used when CFG_REE_FS=y, and is also used by the test PTA core/pta/tests/fs_htree.c. Rather than make the implementation depend on the test (CFG_TEE_CORE_EMBED_INTERNAL_TESTS), do the opposite.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 45ffd851 | 29-Nov-2021 |
Jerome Forissier <jerome@forissier.org> |
core: move tee_svc_storage_create_filename_dfh() to core/tee/tee_fs_rpc.c
tee_svc_storage_create_filename_dfh() is only used in core/tee/tee_fs_rpc.c, so move it there, make it static and give it a
core: move tee_svc_storage_create_filename_dfh() to core/tee/tee_fs_rpc.c
tee_svc_storage_create_filename_dfh() is only used in core/tee/tee_fs_rpc.c, so move it there, make it static and give it a shorter name: create_filename().
Fundamentally, this function is needed when CFG_REE_FS=y but the whole file core/tee/tee_svc_storage.c (which is the current location of this function) essentially defines the storage syscalls for TAs and is therefore not needed when CFG_WITH_USER_TA=n. If we want to later be able to exclude it from the build while still providing secure storage to kernel code, the function has to move.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7c94d5d6 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warnings in core/tee/socket.c
Fixes -Wdeclaration-after-statement warnings in core/tee/socket.c: core/tee/socket.c: In function ‘socket_open’: core/tee/socket.c:44:2: error: ISO C90 forbid
core: Fix warnings in core/tee/socket.c
Fixes -Wdeclaration-after-statement warnings in core/tee/socket.c: core/tee/socket.c: In function ‘socket_open’: core/tee/socket.c:44:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[4] = { ^~~~~~ core/tee/socket.c: In function ‘socket_close’: core/tee/socket.c:76:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm = THREAD_PARAM_VALUE(IN, OPTEE_RPC_SOCKET_CLOSE, ^~~~~~ core/tee/socket.c: In function ‘socket_send’: core/tee/socket.c:108:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~ core/tee/socket.c: In function ‘socket_recv’: core/tee/socket.c:147:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~ core/tee/socket.c: In function ‘socket_ioctl’: core/tee/socket.c:190:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5ab3fbc5 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warnings in core/tee/tadb.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tadb.c: core/tee/tadb.c:111:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-
core: Fix warnings in core/tee/tadb.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tadb.c: core/tee/tadb.c:111:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param params[] = { ^~~~~~ core/tee/tadb.c: In function ‘ta_operation_remove’: core/tee/tadb.c:137:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param params[] = { ^~~~~~ core/tee/tadb.c: In function ‘ta_load’: core/tee/tadb.c:712:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param params[] = { ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 86eb0536 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warnings in core/tee/tee_fs_rpc.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tee_fs_rpc.c: core/tee/tee_fs_rpc.c: In function ‘operation_open_dfh’: core/tee/tee_fs_rpc.c:49:2
core: Fix warnings in core/tee/tee_fs_rpc.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tee_fs_rpc.c: core/tee/tee_fs_rpc.c: In function ‘operation_open_dfh’: core/tee/tee_fs_rpc.c:49:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct tee_fs_rpc_operation op = { ^~~~~~ core/tee/tee_fs_rpc.c: In function ‘tee_fs_rpc_remove_dfh’: core/tee/tee_fs_rpc.c:192:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct tee_fs_rpc_operation op = { ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9ff77e1e | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warnings in core/tee/tee_svc_cryp.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tee_svc_cryp.c: core/tee/tee_svc_cryp.c: In function ‘syscall_cryp_obj_populate’: core/tee/tee_
core: Fix warnings in core/tee/tee_svc_cryp.c
Fixes -Wdeclaration-after-statement warnings in core/tee/tee_svc_cryp.c: core/tee/tee_svc_cryp.c: In function ‘syscall_cryp_obj_populate’: core/tee/tee_svc_cryp.c:1665:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t alloc_size = 0; ^~~~~~ core/tee/tee_svc_cryp.c: In function ‘syscall_obj_generate_key’: core/tee/tee_svc_cryp.c:1907:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t alloc_size = 0; ^~~~~~ core/tee/tee_svc_cryp.c: In function ‘syscall_cryp_derive_key’: core/tee/tee_svc_cryp.c:2975:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t bin_size = params[0].content.ref.length; ^~~~~~ core/tee/tee_svc_cryp.c: In function ‘syscall_asymm_operate’: core/tee/tee_svc_cryp.c:3560:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t alloc_size = 0; ^~~~~~ core/tee/tee_svc_cryp.c: In function ‘syscall_asymm_verify’: core/tee/tee_svc_cryp.c:3734:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] size_t alloc_size = 0; ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b259cc96 | 24-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: Fix warning in register_shm()
Fixes a -Wdeclaration-after-statement warning in register_shm(): core/tee/entry_std.c:491:2: error: ISO C90 forbids mixed declarations and code [-Werror=declarati
core: Fix warning in register_shm()
Fixes a -Wdeclaration-after-statement warning in register_shm(): core/tee/entry_std.c:491:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct optee_msg_param_tmem *tmem = &arg->params[0].u.tmem; ^~~~~~
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8d9a4147 | 08-Oct-2021 |
Elvira Khabirova <e.khabirova@omp.ru> |
core: assure the reader that clear_file(), test_file() are safe
tee_tadb_dir always has files when nbits is greater than 0. Point that out in clear_file() and test_file().
Reviewed-by: Jens Wikland
core: assure the reader that clear_file(), test_file() are safe
tee_tadb_dir always has files when nbits is greater than 0. Point that out in clear_file() and test_file().
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
show more ...
|
| e9907fd7 | 27-Oct-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: pta: socket: enable TA to query recv out buffer
Propagate out size for socket recv event when it's larger than the supplied in size. Also enable passing a NULL buffer while querying the size o
core: pta: socket: enable TA to query recv out buffer
Propagate out size for socket recv event when it's larger than the supplied in size. Also enable passing a NULL buffer while querying the size of the buffer.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e76fe068 | 10-Jun-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: REE FS: report earlier unexpected REE FS reset
When REE FS dirf.db file is not found but RPMB stores a hash for that file it means the REE FS was tampered. This change makes OP-TEE core to rep
core: REE FS: report earlier unexpected REE FS reset
When REE FS dirf.db file is not found but RPMB stores a hash for that file it means the REE FS was tampered. This change makes OP-TEE core to report this status instead of creating the file and let a later access fails due to empty content hash mismatch.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 300faa62 | 30-Apr-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: REE FS: introduce CFG_REE_FS_ALLOW_RESET
New boolean configuration switch CFG_REE_FS_ALLOW_RESET that, when enabled, will make OP-TEE OS to allow REE FS content to be reset in the Linux filesy
core: REE FS: introduce CFG_REE_FS_ALLOW_RESET
New boolean configuration switch CFG_REE_FS_ALLOW_RESET that, when enabled, will make OP-TEE OS to allow REE FS content to be reset in the Linux filesystem even when RPMB FS is enabled and already stores a REE FS rollback protection hash. This switch is intended to test purpose where REE FS can be wiped because the device flash memory was programmed with brand new build artifacts.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 59593713 | 27-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix populate_files() coverity warning
In populate_files() db->files is checked to be not NULL leading but at another place db->nbits is checked instead before accessing db->files. Both checks
core: fix populate_files() coverity warning
In populate_files() db->files is checked to be not NULL leading but at another place db->nbits is checked instead before accessing db->files. Both checks are OK since db->files mustn't be NULL if db->nbits is larger than 0.
This confuses coverity to emit a warning, so change the function to check db->nbits instead.
This fixes coverity scan: CID 1501793 (#1 of 1): Dereference after null check (FORWARD_NULL)
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 68697bf5 | 27-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix tee_fs_dirfile_get_tmp() coverity warning
In tee_fs_dirfile_get_tmp() dirh->files is checked to be not NULL leading but at another place dirh->nbits is checked instead before accessing dir
core: fix tee_fs_dirfile_get_tmp() coverity warning
In tee_fs_dirfile_get_tmp() dirh->files is checked to be not NULL leading but at another place dirh->nbits is checked instead before accessing dirh->files. Both checks are OK since dirh->files mustn't be NULL if dirh->nbits is larger than 0.
This confuses coverity to emit a warning, so change the function to check dirh->nbits instead.
This fixes coverity scan: CID 1501821 (#1 of 1): Dereference after null check (FORWARD_NULL)
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 85076371 | 17-May-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: rpmb: use IS_ENABLED on CFG_RPMB_FS_DEBUG_DATA
Replace #ifdef with if (IS_ENABLED()) for CFG_RPMB_FS_DEBUG_DATA.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jen
core: rpmb: use IS_ENABLED on CFG_RPMB_FS_DEBUG_DATA
Replace #ifdef with if (IS_ENABLED()) for CFG_RPMB_FS_DEBUG_DATA.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 71cbe6bd | 17-May-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: rpmb: remove CFG_RPMB_FS_NO_MAC
Remove CFG_RPMB_FS_NO_MAC that disabled authentication of RPMB frames read from the device. The switch was not documented never enabled in the project hence it
core: rpmb: remove CFG_RPMB_FS_NO_MAC
Remove CFG_RPMB_FS_NO_MAC that disabled authentication of RPMB frames read from the device. The switch was not documented never enabled in the project hence it simply removed.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3cc2413a | 11-May-2021 |
Jerome Forissier <jerome@forissier.org> |
core: allow configuration without any secure storage
Support a configuration with no secure storage (CFG_REE_FS=n and CFG_RPMB_FS=n). In such a case, user TAs will get error code TEEC_ERROR_ITEM_NOT
core: allow configuration without any secure storage
Support a configuration with no secure storage (CFG_REE_FS=n and CFG_RPMB_FS=n). In such a case, user TAs will get error code TEEC_ERROR_ITEM_NOT_FOUND when trying to access persistent objects.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c1bdf4fc | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: spmc: FF-A ABI updates
Updates structs and definitions to follow FF-A version 1.0.
Use the special hard coded UUID (486178e0-e7f8-11e3-bc5e-0002a5d5c51b) for the SP OP-TEE is when compiled fo
core: spmc: FF-A ABI updates
Updates structs and definitions to follow FF-A version 1.0.
Use the special hard coded UUID (486178e0-e7f8-11e3-bc5e-0002a5d5c51b) for the SP OP-TEE is when compiled for FF-A.
Updates the FF-A OP-TEE message ABI to make room for struct optee_msg_arg to be used for RPC for OPTEE_FFA_YIELDING_CALL_WITH_ARG.
struct thread_ctx::rpc_arg for the current thread will always hold a pointer to the struct optee_msg_arg to be used for RPC.
With this allocation of shared memory can be pushed up one layer and be done via the struct optee_msg_arg so the OPTEE_FFA_YIELDING_CALL_RETURN_ALLOC_*_SHM and OPTEE_FFA_YIELDING_CALL_RETURN_FREE_*_SHM can be removed making the FF-A ABI a bit less complicated.
Changes OPTEE_FFA_UNREGISTER_SHM to be a blocking call instead of a yielding call.
Removes the unused OPTEE_FFA_YIELDING_CALL_REGISTER_SHM.
Updates the return values from yielding calls to use the TEE_Result values instead of FF-A one to use the error code from the correct layer.
Defines OPTEE_MSG_FMEM_INVALID_GLOBAL_ID to 0xffffffffffffffffff which is used as an invalid global id instead of 0.
This is an ABI breakage which must be done in sync with the FF-A v4 patchset in the Linux kernel.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2b758a1a | 21-Apr-2021 |
Jerome Forissier <jerome@forissier.org> |
core: tee_pobj_get(): detect access conflict
When tee_pobj_get() is called with TEE_POBJ_USAGE_CREATE and without TEE_DATA_FLAG_OVERWRITE, and the persistent object is found in the list of open obje
core: tee_pobj_get(): detect access conflict
When tee_pobj_get() is called with TEE_POBJ_USAGE_CREATE and without TEE_DATA_FLAG_OVERWRITE, and the persistent object is found in the list of open objects, the function should return TEE_ERROR_ACCESS_CONFLICT immediately. There is no need to call into the FS layer since we know the object exists at this point.
Fixes: https://github.com/OP-TEE/optee_os/issues/4560 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 25c76675 | 29-Mar-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: tee: move entry_std.c to core/tee
entry_std.* are not architecture-specific codes, therefore move entry_std.c to core/tee and entry_std.h to core/include/tee.
Signed-off-by: Marouene Boubakri
core: tee: move entry_std.c to core/tee
entry_std.* are not architecture-specific codes, therefore move entry_std.c to core/tee and entry_std.h to core/include/tee.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| c9366c1e | 26-Mar-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix rsa public exponent check
Fixes the check of the RSA Public Exponent in check_pub_rsa_key(). Prior to this patch was the wrong byte used to check if the bignum was odd. With this patch is
core: fix rsa public exponent check
Fixes the check of the RSA Public Exponent in check_pub_rsa_key(). Prior to this patch was the wrong byte used to check if the bignum was odd. With this patch is the correct byte selected in the big-endian bignum.
Fixes: 338b123ee66c ("core: syscall_obj_generate_key() check public rsa exponent") Reviewed-by: Jerome Forissier <jerome@forissier.org> Suggested-by: Cedric Neveux <cedric.neveux@nxp.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 586d5740 | 22-Mar-2021 |
Jerome Forissier <jerome@forissier.org> |
core: fs: remove unused functions from tee_fs_rpc.c
Remove unused functions from core/tee/tee_fs_rpc.c. As a result, several sub-commands of the OPTEE_RPC_CMD_FS command are now unused: OPTEE_RPC_FS
core: fs: remove unused functions from tee_fs_rpc.c
Remove unused functions from core/tee/tee_fs_rpc.c. As a result, several sub-commands of the OPTEE_RPC_CMD_FS command are now unused: OPTEE_RPC_FS_OPENDIR, OPTEE_RPC_FS_CLOSEDIR and OPTEE_RPC_FS_READDIR. These macros are kept unmodified in the header file core/include/optee_rpc_cmd.h because they are still implemented in tee-supplicant.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e55ecd13 | 16-Mar-2021 |
Stefan Schmidt <snst@meek.de> |
core: use memzero_explicit() to clear sensitive data of tee object
Using preferred memzero_explicit() to clear the sensitive attribute data, which prevents the compiler from optimizing the call away
core: use memzero_explicit() to clear sensitive data of tee object
Using preferred memzero_explicit() to clear the sensitive attribute data, which prevents the compiler from optimizing the call away.
Signed-off-by: Stefan Schmidt <snst@meek.de> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|