KEYS: trusted: tee: Make registered shm dependency explicit
Subsystems (4)
PATCH 1/1 KEYS: trusted: tee: Make registered shm dependency explicit
TEE trusted keys support depends on registered shared memory support since the key buffers are needed to be registered with OP-TEE. So make that dependency explicit to not register trusted keys support if underlying implementation doesn't support registered shared memory.
--- security/keys/trusted-keys/trusted_tee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/keys/trusted-keys/trusted_tee.c +2 -1
@@ -219,7 +219,8 @@ static int trusted_tee_get_random(unsigned char *key, size_t key_len)static int optee_ctx_match (struct tee_ioctl_version_data *ver,const void *data) { -if (ver->impl_id ==TEE_IMPL_ID_OPTEE ) +if (ver->impl_id ==TEE_IMPL_ID_OPTEE && + ver->gen_caps &TEE_GEN_CAP_REG_MEM )return 1 ;else return 0 ;
Signature · 1 line
2.34.1
+ Jarkko (Apologies I accidently missed you while sending the original patch).
Quoted 29 lines · Sumit Garg
TEE trusted keys support depends on registered shared memory support since the key buffers are needed to be registered with OP-TEE. So make that dependency explicit to not register trusted keys support if underlying implementation doesn't support registered shared memory.
Signed-off-by Sumit Garg <[email protected]>Tested-by Jerome Forissier <[email protected]>--- security/keys/trusted-keys/trusted_tee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)security/keys/trusted-keys/trusted_tee.c +2
-2@@ -219,7 +219,8 @@ static int trusted_tee_get_random(unsigned char *key, size_t key_len)static int optee_ctx_match (struct tee_ioctl_version_data *ver,const void *data) { -if (ver->impl_id ==TEE_IMPL_ID_OPTEE ) +if (ver->impl_id ==TEE_IMPL_ID_OPTEE && + ver->gen_caps &TEE_GEN_CAP_REG_MEM )return 1 ;else return 0 ; --2.34.1
Quoted 21 lines · Sumit Garg
+ Jarkko (Apologies I accidently missed you while sending the original patch).
Quoted 18 lines · Sumit Garg
TEE trusted keys support depends on registered shared memory support since the key buffers are needed to be registered with OP-TEE. So make that dependency explicit to not register trusted keys support if underlying implementation doesn't support registered shared memory.
Signed-off-by Sumit Garg <[email protected]>Tested-by Jerome Forissier <[email protected]>--- security/keys/trusted-keys/trusted_tee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)security/keys/trusted-keys/trusted_tee.c +0
-0@@ -219,7 +219,8 @@ static int trusted_tee_get_random(unsigned char *key, size_t key_len)
Quoted 11 lines
Quoted 11 lines
security/keys/trusted-keys/trusted_tee.c +2
-2static int optee_ctx_match (struct tee_ioctl_version_data *ver,const void *data) { -if (ver->impl_id ==TEE_IMPL_ID_OPTEE ) +if (ver->impl_id ==TEE_IMPL_ID_OPTEE && + ver->gen_caps &TEE_GEN_CAP_REG_MEM )return 1 ;else return 0 ; --2.34.1
BR, Jarkko
Quoted 22 lines · Jarkko Sakkinen
Quoted 21 lines · Sumit Garg
+ Jarkko (Apologies I accidently missed you while sending the original patch).
Quoted 18 lines · Sumit Garg
TEE trusted keys support depends on registered shared memory support since the key buffers are needed to be registered with OP-TEE. So make that dependency explicit to not register trusted keys support if underlying implementation doesn't support registered shared memory.
Signed-off-by Sumit Garg <[email protected]>Tested-by Jerome Forissier <[email protected]>--- security/keys/trusted-keys/trusted_tee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)security/keys/trusted-keys/trusted_tee.c +0
-0@@ -219,7 +219,8 @@ static int trusted_tee_get_random(unsigned char *key, size_t key_len)
Quoted 13 lines
Quoted 11 lines
Quoted 11 lines
security/keys/trusted-keys/trusted_tee.c +2
-2static int optee_ctx_match (struct tee_ioctl_version_data *ver,const void *data) { -if (ver->impl_id ==TEE_IMPL_ID_OPTEE ) +if (ver->impl_id ==TEE_IMPL_ID_OPTEE && + ver->gen_caps &TEE_GEN_CAP_REG_MEM )return 1 ;else return 0 ; --2.34.1
Reviewed-by Jarkko Sakkinen <[email protected]>
Applied.
BR, Jarkko