| 1f648d54 | 09-Oct-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove struct tee_ta_ctx from struct user_mode_ctx
Removes struct tee_ta_ctx from struct user_mode_ctx allowing a user mode entity to be independent of the TA concept, that is, making room for
core: remove struct tee_ta_ctx from struct user_mode_ctx
Removes struct tee_ta_ctx from struct user_mode_ctx allowing a user mode entity to be independent of the TA concept, that is, making room for SPs in user mode.
A pointer to a struct user_mode_ctx is passed to many memory management functions where a pointer to a struct ts_ctx is needed too. Prior to this patch it was possible to calculate that address of corresponding struct ts_ctx with help of the container_of() macro, that is no longer possible. Instead is a struct ts_ctx *ts_ctx field added to struct user_mode_ctx in order to allow such lookups.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3560d990 | 01-Sep-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic struct ts_ctx
Adds the generic struct ts_ctx to be used instead of struct tee_ta_ctx where generic context operations are performed.
struct tee_ta_ctx adds a field with struct ts_
core: add generic struct ts_ctx
Adds the generic struct ts_ctx to be used instead of struct tee_ta_ctx where generic context operations are performed.
struct tee_ta_ctx adds a field with struct ts_ctx for conversion to struct ts_ctx where needed.
The struct ts_session is updated to keep a pointer to a struct ts_ctx instead of the previous struct tee_ta_ctx.
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 ...
|
| 8f51d0a4 | 16-Oct-2020 |
Stefan Schmidt <snst@meek.de> |
core: rpmb: check return value of encrypt_block()
Added error handling if call of function encrypt_block() fails in tee_rpmb_req_pack().
Signed-off-by: Stefan Schmidt <snst@meek.de> Reviewed-by: Je
core: rpmb: check return value of encrypt_block()
Added error handling if call of function encrypt_block() fails in tee_rpmb_req_pack().
Signed-off-by: Stefan Schmidt <snst@meek.de> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 3b11b1d2 | 12-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
core: rpmb: fix off-by-one in block index check
The max block index check in tee_rpmb_req_pack() is incorrect and would fail when trying to access the last block of the partition.
Signed-off-by: Je
core: rpmb: fix off-by-one in block index check
The max block index check in tee_rpmb_req_pack() is incorrect and would fail when trying to access the last block of the partition.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 589a4941 | 09-Oct-2020 |
Jerome Forissier <jerome@forissier.org> |
core: use vaddr_t instead of uint32_t for object IDs
Some function incorrectly use uint32_t for object identifiers: tee_obj_get(), tee_svc_cryp_get_state() and tee_svc_storage_get_enum(). Those obje
core: use vaddr_t instead of uint32_t for object IDs
Some function incorrectly use uint32_t for object identifiers: tee_obj_get(), tee_svc_cryp_get_state() and tee_svc_storage_get_enum(). Those object IDs are actually virtual addresses so they need to be of type vaddr_t.
Link: https://github.com/OP-TEE/optee_os/issues/4035#issuecomment-680037072 Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 3b354b19 | 02-Oct-2020 |
Neil Shipp <neilsh@microsoft.com> |
core: Fix RPMB fat entry cache buffer overflow
Ensure that fat_entry_dir_update can only update entries less than the current cache size and not just the maximum size limit of the cache.
Signed-off
core: Fix RPMB fat entry cache buffer overflow
Ensure that fat_entry_dir_update can only update entries less than the current cache size and not just the maximum size limit of the cache.
Signed-off-by: Neil Shipp <neilsh@microsoft.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@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 ...
|
| 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 ...
|