From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09FEFC433B4 for ; Fri, 21 May 2021 13:13:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FBBA613D8 for ; Fri, 21 May 2021 13:13:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FBBA613D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 88C5082E1E; Fri, 21 May 2021 15:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bR/Kvgds"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A209D82E37; Fri, 21 May 2021 15:13:19 +0200 (CEST) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 65FC682E1E for ; Fri, 21 May 2021 15:13:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=etienne.carriere@linaro.org Received: by mail-ej1-x634.google.com with SMTP id et19so23354223ejc.4 for ; Fri, 21 May 2021 06:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Htw801ONthsXKTR6xNp2zhb0YyMu4aiIvwrluHuu1P0=; b=bR/KvgdsU/ArEDTPoECBaDkQ//6cu7psSxB3Qi8BsfH9EWPlW5AV0TKBlP42oUUzj7 DHEBYw/PrB5W57G4U8aOnO6Q2AJHpLnd5NkuZfTKpiwCsJrPNVAsx5hHZFuaqo+EbTPa UEOAXyaM5Jawhg2J8pQdV90UmyKC+XRFTk264s8VOHYedXG/+Du70V+1TfBp4IEJo7Nw 2Ty4wyaDZs/+9EDxJJ6aWEciGI8LYAXSZX5ITVcAoVgv4Sy0rxOaDJ0XTRYVQaXzoEKy j7lGpRxSoItW4Td4FLr7HoXLavtUKrt4CWhrHJezd6H4CARCnB2VcUl8qKKYwqq2fPUP Cj3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Htw801ONthsXKTR6xNp2zhb0YyMu4aiIvwrluHuu1P0=; b=OQ6RMgb0is+JoMsZfac9IdhAfmF15EMBX/hmUawty5dKQn1yCnwVyTBPRia1DuTzZz epMTKlaCE079/JLjhKtDmUJiJsu5ECmFGhBQ7eaKyCpqJtI8WG7Dj4044J8Ev763AjrD XVQe+CFfUORcgDtxVzkzGwvX+1ax6Cs0rcl7zxoH+wkooxBOWU9N4WxdJ17SXFsk66a/ HnqcBG0aTnTu35FaxycKPUsls9gHRwXSEtLxusS9nWyCiM8HaVQm0b3fFt8vMSwYeRi0 Hocd6dHBKm8jeGr88yFm3NCnAEo4Cl3PTmJpk/J2PwIQrfyAKAUdzvMsHew3654AUlDe vgyw== X-Gm-Message-State: AOAM533ZrpwJV5xpKbxHIwrQtCdecqij0NuKyfu0at7JUHBc8HUwauT2 cwAjFY4ZyYbX67NU51SvSos1bcDK6LUXgbMQMMrlFnP/bd8zkw== X-Google-Smtp-Source: ABdhPJz7M26LpfprHoyWPAo1sdsGUE7hbFV3GDly8TzofagAeY9rc++n0V8E/I8NRq3IK02xBecZm7ZgzQ+1ZJFyVgc= X-Received: by 2002:a17:906:bb0e:: with SMTP id jz14mr10166646ejb.285.1621602796017; Fri, 21 May 2021 06:13:16 -0700 (PDT) MIME-Version: 1.0 References: <20210519142613.7668-1-etienne.carriere@linaro.org> <20210519142613.7668-2-etienne.carriere@linaro.org> In-Reply-To: From: Etienne Carriere Date: Fri, 21 May 2021 15:13:05 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] tee: optee: support session login as REE kernel To: Jens Wiklander Cc: U-Boot Mailing List , Simon Glass Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On Thu, 20 May 2021 at 16:56, Jens Wiklander wrote: > > On Wed, May 19, 2021 at 4:27 PM Etienne Carriere > 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 > > --- > > 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. Yes, we could simply pass the identifier, whatever it is. i'll remove this part in the v3. Cheers, Etienne > > Cheers, > Jens