[PATCH] KEYS: trusted: tee: Make registered shm dependency explicit

Jarkko Sakkinen jarkko at kernel.org
Wed Nov 16 00:33:22 UTC 2022


On Thu, Nov 10, 2022 at 04:44:20PM +0530, Sumit Garg wrote:
> + Jarkko (Apologies I accidently missed you while sending the original patch).
> 
> On Thu, 10 Nov 2022 at 16:42, Sumit Garg <sumit.garg at linaro.org> wrote:
> >
> > 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 at linaro.org>
> > Tested-by: Jerome Forissier <jerome.forissier at linaro.org>
> > ---
> >  security/keys/trusted-keys/trusted_tee.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/security/keys/trusted-keys/trusted_tee.c b/security/keys/trusted-keys/trusted_tee.c
> > index c8626686ee1b..ac3e270ade69 100644
> > --- a/security/keys/trusted-keys/trusted_tee.c
> > +++ b/security/keys/trusted-keys/trusted_tee.c
> > @@ -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
> >

Reviewed-by: Jarkko Sakkinen <jarkko at kernel.org>

BR, Jarkko



More information about the Linux-security-module-archive mailing list