| be041efc | 01-Oct-2020 |
Neil Shipp <neilsh@microsoft.com> |
core: Bad assert in fat_entry_dir_update()
Fix an assert in fat_entry_dir_update() that always fires when updating fat entries other than the first element in the cache.
Signed-off-by: Neil Shipp <
core: Bad assert in fat_entry_dir_update()
Fix an assert in fat_entry_dir_update() that always fires when updating fat entries other than the first element in the cache.
Signed-off-by: Neil Shipp <neilsh@microsoft.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| c56cc686 | 13-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: include parity in DES/DES3 key sizes
Update from GP 1.0 the parity bits are now included in the DES and DES3 key sizes. This is an incompatible change where 56, 112 and 168 key sizes are repla
core: include parity in DES/DES3 key sizes
Update from GP 1.0 the parity bits are now included in the DES and DES3 key sizes. This is an incompatible change where 56, 112 and 168 key sizes are replaced with 64, 128 and 192 respectively.
This changes the ABI in a way that it's not enough even to recompile the TA. In order to maintain backwards compatibility the configuration flag CFG_COMPAT_GP10_DES is introduced (default y). The presence of the parity bits is autodetected and this update is transparent to a TA which hasn't been updated.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 68c68bce | 09-Sep-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_asymm_verify(): accurate DSA parameter check
A comment in syscall_asymm_verify() reads: "Depending on the DSA algorithm (NIST), the digital signature output size may be truncated to th
core: syscall_asymm_verify(): accurate DSA parameter check
A comment in syscall_asymm_verify() reads: "Depending on the DSA algorithm (NIST), the digital signature output size may be truncated to the size of a key pair (Q prime size). Q prime size must be less or equal than the hash output length of the hash algorithm involved."
Instead of just assuming that Q size is small when data length is smaller than the hash, check that it's the case also. Don't allow data length smaller than both hash size and Q size.
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b9416909 | 24-Sep-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Provide TEE_ATTR_FLAG_VALUE and TEE_ATTR_FLAG_PUBLIC
Provides TEE_ATTR_FLAG_VALUE and TEE_ATTR_FLAG_PUBLIC which are defined already in GP v1.0 [1] and also expected in GP v1.1 [2]. The old TEE_ATTR
Provide TEE_ATTR_FLAG_VALUE and TEE_ATTR_FLAG_PUBLIC
Provides TEE_ATTR_FLAG_VALUE and TEE_ATTR_FLAG_PUBLIC which are defined already in GP v1.0 [1] and also expected in GP v1.1 [2]. The old TEE_ATTR_BIT_VALUE and TEE_ATTR_BIT_PROTECTED are kept for backwards compatibility for now.
[1]: GlobalPlatform TEE Internal API Specification v1.0 [2]: GlobalPlatform TEE Internal Core API Specification v1.1
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d9281a0c | 19-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: check that certain object attributes are consistent with max key size
When populating a crypto object check that certain attributes are consistent with maximum key size. For example the attrib
core: check that certain object attributes are consistent with max key size
When populating a crypto object check that certain attributes are consistent with maximum key size. For example the attribute TEE_ATTR_DSA_PRIME must not have more significant bits than max key size. All these attributes are flagged with TEE_TYPE_ATTR_BIGNUM_MAXBITS and tee_svc_cryp_obj_populate_type() is updated as needed.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d1272505 | 19-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: check that object attributes for current usage are relevant
When populating or generating a key the relevant attributes can differ. Some attributes are parameters for the key generation.
Upda
core: check that object attributes for current usage are relevant
When populating or generating a key the relevant attributes can differ. Some attributes are parameters for the key generation.
Updates tee_svc_cryp_check_attr() and object type descriptions to be accurate.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 73e18e2d | 19-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: check max key size when populating object
Checks that attributes are within the bounds defined by the max key size which was supplied when the object was allocated.
Acked-by: Etienne Carriere
core: check max key size when populating object
Checks that attributes are within the bounds defined by the max key size which was supplied when the object was allocated.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dbc27a6f | 22-Sep-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix calculation of DES key size
Prior to this patch was the parity bits included when calculating the key size for DES keys. Fix this by subtracting the parity bits.
Acked-by: Etienne Carrier
core: fix calculation of DES key size
Prior to this patch was the parity bits included when calculating the key size for DES keys. Fix this by subtracting the parity bits.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6c276b08 | 18-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: tee_obj_get() return TEE_ERROR_BAD_STATE
Updates tee_obj_get() to return TEE_ERROR_BAD_STATE when an object reference can't be found. This will allow the GP TA API to panic the caller as requi
core: tee_obj_get() return TEE_ERROR_BAD_STATE
Updates tee_obj_get() to return TEE_ERROR_BAD_STATE when an object reference can't be found. This will allow the GP TA API to panic the caller as required in the GP spec [1].
[1] GlobalPlatform TEE Internal Core API Specification v1.1 Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 338b123e | 18-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_obj_generate_key() check public rsa exponent
The v1.1 spec [1] requires that the NIST SP800-56B [2] rules to be followed when generating an RSA key.
Adds a check when generating a RSA
core: syscall_obj_generate_key() check public rsa exponent
The v1.1 spec [1] requires that the NIST SP800-56B [2] rules to be followed when generating an RSA key.
Adds a check when generating a RSA key that the supplied exponent confirms with the requirements in NIST SP800-56B, thas is, the key must be odd and in the range 65537 <= e < 2^256.
[1]: GlobalPlatform TEE Internal Core API Specification v1.1 Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Link [2]: https://csrc.nist.gov/publications/detail/sp/800-56b/rev-2/final
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9760936c | 13-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_cryp_obj_alloc(): allow TEE_TYPE_DATA for transient objects
GP 1.1 spec [1] explicitly allows creation of TEE_TYPE_DATA object. So update syscall_cryp_obj_alloc() accordingly.
[1]: G
core: syscall_cryp_obj_alloc(): allow TEE_TYPE_DATA for transient objects
GP 1.1 spec [1] explicitly allows creation of TEE_TYPE_DATA object. So update syscall_cryp_obj_alloc() accordingly.
[1]: GlobalPlatform TEE Internal Core API Specification v1.1 Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e12c9f67 | 11-Sep-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: strict buffer check in syscalls following GP 1.1
GP 1.1 [1] and also earlier specifications has certain annotation in the description of API functions to among other things describe which kind
core: strict buffer check in syscalls following GP 1.1
GP 1.1 [1] and also earlier specifications has certain annotation in the description of API functions to among other things describe which kind of memory a buffer is required to reside in. It could be readable, writeable, in shared memory in TA private memory.
The following syscalls are updated with slightly stricter checks with regards to TA private memory where needed: - syscall_open_ta_session() - syscall_invoke_ta_command() - syscall_get_time() - syscall_set_ta_time() - syscall_cryp_obj_get_info() - syscall_cryp_random_number_generate() - syscall_authenc_dec_final() - syscall_storage_next_enum() - syscall_storage_obj_read() - syscall_storage_obj_write()
[1]: GlobalPlatform TEE Internal Core API Specification v1.1
Acked-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 ...
|
| c40a6505 | 21-Jun-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: separate copy_from_user() and friends
Removes the tee_svc_ prefix and moves tee_svc_copy_from_user() and friends into <kernel/user_access.h> and core/kernel/user/access.c
Reviewed-by: Jerome
core: separate copy_from_user() and friends
Removes the tee_svc_ prefix and moves tee_svc_copy_from_user() and friends into <kernel/user_access.h> and core/kernel/user/access.c
Reviewed-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 ...
|
| 63146177 | 19-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add tee_pobj_create_final()
Adds tee_pobj_create_final() which finalized a create operation. Until tee_pobj_create_final() has been called the struct pobj cannot be shared with any other objec
core: add tee_pobj_create_final()
Adds tee_pobj_create_final() which finalized a create operation. Until tee_pobj_create_final() has been called the struct pobj cannot be shared with any other object.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 928efd06 | 18-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_storage_next_enum() use live pobj
Instead of using a fake pobj in syscall_storage_next_enum() retrieve the shared pobj instead in order to get the flags of an already opened object.
T
core: syscall_storage_next_enum() use live pobj
Instead of using a fake pobj in syscall_storage_next_enum() retrieve the shared pobj instead in order to get the flags of an already opened object.
TEE_POBJ_USAGE_ENUM is supplied to tee_pobj_get() to avoid checking for conflicts with how the pobj is already used.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6885abf2 | 18-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: tee_pobj_get() takes an enum tee_pobj_usage
Changes tee_pobj_get() to take an enum tee_pobj_usage usage instead of a bool temporary.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signe
core: tee_pobj_get() takes an enum tee_pobj_usage
Changes tee_pobj_get() to take an enum tee_pobj_usage usage instead of a bool temporary.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 06b0fe08 | 14-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove struct tee_obj::flags
struct tee_obj keeps a TEE_ObjectInfo which has a flags field with the same meaning as the flags field in struct tee_obj. To avoid the two fields getting out of sy
core: remove struct tee_obj::flags
struct tee_obj keeps a TEE_ObjectInfo which has a flags field with the same meaning as the flags field in struct tee_obj. To avoid the two fields getting out of sync remove struct tee_obj::flags and only use TEE_ObjectInfo::handleFlags.
Additional checks are added in syscall_storage_obj_open() and syscall_storage_obj_create() to make sure that no undefined flags are added to TEE_ObjectInfo::handleFlags.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5e817523 | 13-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: syscall_storage_obj_create(): check that the attributes object is initialized
Adds a check in syscall_storage_obj_create() to see that the attributes object is initialized.
Reviewed-by: Jerom
core: syscall_storage_obj_create(): check that the attributes object is initialized
Adds a check in syscall_storage_obj_create() to see that the attributes object is initialized.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1a7d8eae | 17-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add user parameter thread_rpc_shm_cache_alloc()
Adds a user parameter to thread_rpc_shm_cache_alloc() to make sure that different callers of thread_rpc_shm_cache_alloc() doesn't interfere with
core: add user parameter thread_rpc_shm_cache_alloc()
Adds a user parameter to thread_rpc_shm_cache_alloc() to make sure that different callers of thread_rpc_shm_cache_alloc() doesn't interfere with each other. The FS allocation could perhaps be intertwined with I2C allocations if crypto operations are done over I2C.
Fixes: 9bee8f2a5af7 ("core: add generic rpc shared memory buffer caching") Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ce9a20c1 | 30-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
rmpb: fix infinite recursion in dump_fat() when CFG_TEE_CORE_LOG_LEVEL=4
When CFG_TEE_CORE_LOG_LEVEL=4 and CFG_RPMB_FS=y, the TEE core crashes with a dead stack canary message:
E/TC:0 0 Dead canar
rmpb: fix infinite recursion in dump_fat() when CFG_TEE_CORE_LOG_LEVEL=4
When CFG_TEE_CORE_LOG_LEVEL=4 and CFG_RPMB_FS=y, the TEE core crashes with a dead stack canary message:
E/TC:0 0 Dead canary at end of 'stack_abt[3]' E/TC:0 0 Panic at core/arch/arm/kernel/thread.c:192 <thread_check_canaries> E/TC:0 0 TEE load address @ 0x1bd0f000 E/TC:0 0 Call stack: E/TC:0 0 0x1bd17b3d print_kernel_stack at optee_os/core/arch/arm/kernel/unwind_arm32.c:452 E/TC:0 0 0x1bd23a07 __do_panic at optee_os/core/kernel/panic.c:32 (discriminator 1) E/TC:0 0 0x1bd120cb thread_check_canaries at optee_os/core/arch/arm/kernel/thread.c:188 (discriminator 2) E/TC:0 0 0x1bd12c1f thread_state_suspend at optee_os/core/arch/arm/kernel/thread.c:754 E/TC:0 0 0x1bd14610 thread_rpc at optee_os/core/arch/arm/kernel/thread_optee_smc_a32.S:227
The issue happens to be with the debug function dump_fat() which causes infinite recursion. Fix it by doing nothing until after RPMB initialization has completed.
Fixes: 5f68d7848fe8 ("core: RPMB FS: Caching for FAT FS entries") Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7446af61 | 21-Jul-2020 |
Jerome Forissier <jerome@forissier.org> |
core: log message when secure storage corruption is detected
When CFG_REE_FS and CFG_RPMB_FS are both 'y', the data stored by OP-TEE in the REE filesystem (typically, under /data/tee) are protected
core: log message when secure storage corruption is detected
When CFG_REE_FS and CFG_RPMB_FS are both 'y', the data stored by OP-TEE in the REE filesystem (typically, under /data/tee) are protected by hashes stored in the RPMB. Any modifications to the REE files via external means are therefore detected and TEE_ERROR_SECURITY is returned. However, no error or debug message is printed to the secure console which makes troubleshooting more difficult than needed. This commit adds a debug message.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9bee8f2a | 21-Jul-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic rpc shared memory buffer caching
Replaces tee_fs_rpc_cache_alloc() with thread_rpc_shm_alloc() which also takes a shared memory type as argument. This allows allocating an kernel p
core: add generic rpc shared memory buffer caching
Replaces tee_fs_rpc_cache_alloc() with thread_rpc_shm_alloc() which also takes a shared memory type as argument. This allows allocating an kernel private RPC buffer when needed.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1b97b785 | 05-Jul-2020 |
Roland Nagy <rnagy@xmimx.tk> |
core: fix tee_fs_rpc_readdir() parameter direction
The type of params[1] is changed to OUT to match the expected params in tee-supplicant's tee_fs_rpc_readdir, so calls to tee_fs_rpc_readdir won't f
core: fix tee_fs_rpc_readdir() parameter direction
The type of params[1] is changed to OUT to match the expected params in tee-supplicant's tee_fs_rpc_readdir, so calls to tee_fs_rpc_readdir won't fail with TEE_ERROR_BAD_PARAMETERS.
Signed-off-by: Roland Nagy <rnagy@xmimx.tk> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e762809b | 11-May-2020 |
Gianguido Sorà <me@gsora.xyz> |
rpmb: fix building when TRACE_LEVEL >= TRACE_FLOW
Building with CFG_RPMB_FS=y and CFG_TEE_CORE_LOG_LEVEL=4 yields a compile-time error due to a typo.
Replacing TEE_RESULT with TEE_Result fixes the
rpmb: fix building when TRACE_LEVEL >= TRACE_FLOW
Building with CFG_RPMB_FS=y and CFG_TEE_CORE_LOG_LEVEL=4 yields a compile-time error due to a typo.
Replacing TEE_RESULT with TEE_Result fixes the issue.
Signed-off-by: Gianguido Sorà <me@gsora.xyz> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| 66d685f1 | 28-Apr-2020 |
Peikan Tsai <peikantsai@gmail.com> |
rpmb: remove unnecessary check
Remove unnecessary check to fix compile warning reported by clang as following:
core/tee/tee_rpmb_fs.c:2051:11: warning: address of array 'fh->filename' will always e
rpmb: remove unnecessary check
Remove unnecessary check to fix compile warning reported by clang as following:
core/tee/tee_rpmb_fs.c:2051:11: warning: address of array 'fh->filename' will always evaluate to 'true' [-Wpointer-bool-conversion] if (fh->filename && (!strcmp(fh->filename, fe->filename)) && ~~~~^~~~~~~~ ~~ core/tee/tee_rpmb_fs.c:2134:10: warning: address of array 'fh->filename' will always evaluate to 'true' [-Wpointer-bool-conversion] if (fh->filename && !fh->rpmb_fat_address) ~~~~^~~~~~~~ ~~
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com> Signed-off-by: Peikan Tsai <peikantsai@gmail.com> Reviewed-by: YJ Chiang <yj.chiang@mediatek.com> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|