]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
KEYS: trusted: tee: Make registered shm dependency explicit
authorSumit Garg <sumit.garg@linaro.org>
Thu, 10 Nov 2022 11:11:40 +0000 (16:41 +0530)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 8 Dec 2022 16:20:46 +0000 (16:20 +0000)
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 <sumit.garg@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/trusted_tee.c

index c8626686ee1b72045adaafa373336c2f62a2651d..ac3e270ade69be9e32bdc7059f2e06195a548063 100644 (file)
@@ -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;