All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Wiklander <jens.wiklander@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/2] tee: optee: support session login as REE kernel
Date: Thu, 20 May 2021 16:56:30 +0200	[thread overview]
Message-ID: <CAHUa44EktqK7F4OQvXmpKjo=42nSWSqwvkK7rZjPm_MfqzkGKg@mail.gmail.com> (raw)
In-Reply-To: <20210519142613.7668-2-etienne.carriere@linaro.org>

On Wed, May 19, 2021 at 4:27 PM Etienne Carriere
<etienne.carriere@linaro.org> wrote:
>
> Remove unused OPTEE_MSG_LOGIN_* IDs and rely on the ones introduced in
> tee.h. Change optee core to treat invalid client IDs as public login.
>
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
> ---
> Changes since v1:
> - Remove ID conversion. I kept the sanitation of login ID for optee.
> ---
>  drivers/tee/optee/core.c      | 19 ++++++++++++++++++-
>  drivers/tee/optee/optee_msg.h | 10 ----------
>  2 files changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
> index 73dbb22ba0..14f9cce5f8 100644
> --- a/drivers/tee/optee/core.c
> +++ b/drivers/tee/optee/core.c
> @@ -349,6 +349,23 @@ static int optee_close_session(struct udevice *dev, u32 session)
>         return 0;
>  }
>
> +static u32 optee_login_id(u32 login_id)
> +{
> +       /* Treat invalid IDs as public login */
> +       switch (login_id) {
> +       case TEE_LOGIN_USER:
> +       case TEE_LOGIN_GROUP:
> +       case TEE_LOGIN_APPLICATION:
> +       case TEE_LOGIN_APPLICATION_USER:
> +       case TEE_LOGIN_APPLICATION_GROUP:
> +       case TEE_LOGIN_REE_KERNEL:
> +               return login_id;
> +       case TEE_LOGIN_PUBLIC:
> +       default:
> +               return TEE_LOGIN_PUBLIC;
> +       }
> +}
> +

What is the point with translating an unrecognized value into TEE_LOGIN_PUBLIC?
We could just as well let OP-TEE decide what to do with that.

Cheers,
Jens

  reply	other threads:[~2021-05-20 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 14:26 [PATCH v2 1/2] tee: define session login identifiers Etienne Carriere
2021-05-19 14:26 ` [PATCH v2 2/2] tee: optee: support session login as REE kernel Etienne Carriere
2021-05-20 14:56   ` Jens Wiklander [this message]
2021-05-21 13:13     ` Etienne Carriere
2021-05-20 14:49 ` [PATCH v2 1/2] tee: define session login identifiers Jens Wiklander
2021-05-21 13:17   ` Etienne Carriere

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHUa44EktqK7F4OQvXmpKjo=42nSWSqwvkK7rZjPm_MfqzkGKg@mail.gmail.com' \
    --to=jens.wiklander@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.