From patchwork Wed Dec 7 15:25:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1713341 X-Patchwork-Delegate: apalos@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=qJGeMOkY; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NS1MQ5KsBz23pB for ; Thu, 8 Dec 2022 02:25:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13BA08517E; Wed, 7 Dec 2022 16:25:48 +0100 (CET) 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="qJGeMOkY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 332C48510E; Wed, 7 Dec 2022 16:25:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 DA3A485476 for ; Wed, 7 Dec 2022 16:25:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=etienne.carriere@linaro.org Received: by mail-wm1-x333.google.com with SMTP id l26so7662770wms.4 for ; Wed, 07 Dec 2022 07:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UzNkHNbvcHCzhBJcgaqaimIsO34b+CK7jt/4ioacWTM=; b=qJGeMOkYqS/xWJU2zazo+N88QKcPZYDz1IcUmHHc88K/t7gLIyr4HF3n+hCjN0588v 4lmDcdR1WrvAOagRKRTlL4GAOiSOyHL1KKQW67t44CvOh7NlXL9ZXeAxa1H/x0J3XEX/ 54HpVa6e3R6ZiTddJ0ixtgU7GePp76Fw9mF8KC5AghJMFBAOqo8kgMOHyy7mdY/DOszk XZkWm47IafdEMQAeO2aOWDYifcUey6b4m1O6MW+rCJCN5T0wUUvKp0DibIDvdTtYGBZI 9tB12K1aKfBp6BEG4TnIqurgWpJMPuYJNXs4iIhz1WUmRyKdhy5l4k/Dk9cfigRy8VBJ TTbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UzNkHNbvcHCzhBJcgaqaimIsO34b+CK7jt/4ioacWTM=; b=tQg7oh5yW1+hj1LTI3oLX8jNi8sPm0qAfkmzMTD8DYiulHHbHSKMJf4oMGPKzh5Qod U27f8aat4iilKeFdgDQUh/xU4ZR2B4B+YKolSlcQHI26r698jkehmA6cZHlHcstXGZ4C MrKgo4orZiPJa5/07gcwd+P0ZyGjZogOWLSXo0kbsSyiZnRUw6YbQVAqC7nw3ictuUit pk9LeSoyNyaKbNSy52iRtTnyDT6ouIr7Z0fMCo10VZ45taoyuZuqhtsUAzhCasDpV40u wGqVtpVnlHgolbyAfUIBu6qinhHQFU0Ft3rpxlxMbiCTZy8EbB3q+MgZcjykD7ILZnUR jASw== X-Gm-Message-State: ANoB5pmLV+7JUqUUsGU0VJqt40M+69iv9+16h67DktIBYpqnzjfweK/v XGNlHxhKKldoELi82Lc9eP+cRG1l15QpILc5 X-Google-Smtp-Source: AA0mqf4tnfG+8ceOUrL2STaXjHT+wYGOPUpybjhDyi3Q9w1GoJK4nc1ZYONW/NrECNRRq91goUOPOQ== X-Received: by 2002:a05:600c:1e08:b0:3cf:8e62:f8fd with SMTP id ay8-20020a05600c1e0800b003cf8e62f8fdmr763662wmb.8.1670426741110; Wed, 07 Dec 2022 07:25:41 -0800 (PST) Received: from lmecxl1178.lme.st.com ([80.215.162.103]) by smtp.gmail.com with ESMTPSA id z13-20020a05600c220d00b003cf71b1f66csm2061673wml.0.2022.12.07.07.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 07:25:40 -0800 (PST) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Etienne Carriere Subject: [PATCH] tpm2: ftpm: open session with privileged ree login Date: Wed, 7 Dec 2022 16:25:33 +0100 Message-Id: <20221207152533.532974-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean Opens the fTPM session with TEE_LOGIN_REE_KERNEL as fTPM may restrict access to that login when Linux based OS is running as applications are expected to got through the Linux TPMv2 driver. Signed-off-by: Etienne Carriere Reviewed-by: Ilias Apalodimas --- drivers/tpm/tpm2_ftpm_tee.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tpm/tpm2_ftpm_tee.c b/drivers/tpm/tpm2_ftpm_tee.c index 53e59f42b4..3c4c12983d 100644 --- a/drivers/tpm/tpm2_ftpm_tee.c +++ b/drivers/tpm/tpm2_ftpm_tee.c @@ -186,6 +186,7 @@ static int ftpm_tee_probe(struct udevice *dev) /* Open a session with the fTPM TA */ memset(&sess_arg, 0, sizeof(sess_arg)); + sess_arg.clnt_login = TEE_LOGIN_REE_KERNEL; tee_optee_ta_uuid_to_octets(sess_arg.uuid, &uuid); rc = tee_open_session(context->tee_dev, &sess_arg, 0, NULL);