Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1325781pxb; Fri, 27 Aug 2021 06:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjNTE0IFWh9HdeScsFW50rT0Ld1FVzqNBx3lpAUHTVy74HFDs3XSMKARBEjONniKC/Ew5W X-Received: by 2002:a92:c9cf:: with SMTP id k15mr6700571ilq.125.1630071136810; Fri, 27 Aug 2021 06:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630071136; cv=none; d=google.com; s=arc-20160816; b=h+BvErngOff8Y6bIYf9RwlbbTLj3HRkdKuC3b+j4xYYEmjcKNg+oX6CXP4mx4ybIn8 ST+xd6nFnrNzH1G+F0wglskkMF/n5w1WFLPr7JoEzA0VyEC+oTtFdPWNSXDwAI0YwcBA RFjnLU86OPAPCoIZmwvQExyXH8poso/ZWPk+jEH2AATKmSCIrNmSv9GSpoNDQ1d26VyK GyVjCusolPCBfHWDjmwvXUJHG3+tYuVuHTQSUxxOELHHqtL1VjraSklr07rrUDOUufJa c/ZxEna3SN6NxkXf1w3fGHf/HY+7IyFY4rtpJzHiCkFghSdiGhsNpi4nPV4AUR3EHbM2 Wwzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9hYvHFGz/V7D23iiTPTOyxcZm7pKUcDRg4kDhPveMaM=; b=KwZyRwckjUd+R2pBrV1lDXt30hHPnR4nu3yTgVVrep7Kb7hV6nyGOLJdPL7XSwAnxk bWz/T+SzVHDFnyVQpd8SkfyPvGxn7fT9IA0acPkTGseOHGzmQDHBARikaF3DhG+tBoYI AIPvzRCsy0VvrbZXhHsSoppWCK5cO9eefiPihsdURH0Y+ufusWOI7QrcLCIG3ubRvFWk ClIooE2Cru00sUdE345pl4JOcmOuRRCQ27xqz+tIWtnbZCyTrzwDF0C4+5LT/nzpYQH+ nRc8sS9Ko+Uc+q8JZXVxE+PnIx/Pl7SbKxk76Vh1XbNVmhoGb6hw3BNmCc2SLN+zhPHS jjfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RWh3PyaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si5886441jam.97.2021.08.27.06.32.03; Fri, 27 Aug 2021 06:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RWh3PyaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245191AbhH0NbC (ORCPT + 99 others); Fri, 27 Aug 2021 09:31:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245127AbhH0NbC (ORCPT ); Fri, 27 Aug 2021 09:31:02 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE8DC0613D9 for ; Fri, 27 Aug 2021 06:30:13 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id ew6so3958388qvb.5 for ; Fri, 27 Aug 2021 06:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9hYvHFGz/V7D23iiTPTOyxcZm7pKUcDRg4kDhPveMaM=; b=RWh3PyaLn9DmYFUvWMAb0sMx7t5tv8neu2ri9D8mJwjUh0f9X4mBOK1mWoSNx+Xk7Q UXygO2RUgsM9ytHw0J7ZnZXf2r3UP4CjRgIHdV2VX/t+bSo6kamNRr5JE5kNDltUDNzn WQgF2d+L0cB45zjDOFEV11+rf/T7+4zgjItd3QTdskgaWTbyVTVvxaCh837ERZ9KLWWx 6TAPmCSOQ6wzP73NwO/nlGoXEsh1OPCVaa9p1VGWwEwyT1w8H6tsGbZ3QUOGbnXVXzFe STjKaFkm5jV0/3qBR3EBlTYcZnURiYHMgxlqQvSKJJpwNGztKUytgfSlnkTIo0X69uPm QMFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9hYvHFGz/V7D23iiTPTOyxcZm7pKUcDRg4kDhPveMaM=; b=NCk85rp4xsPYv821JJEzRgG0Hs65JIakKYMslBg9A7GXIT0X5ml//ZbQYtImalo9hf ovRyTIrbGkh2CPP7qhAMtTmcoccgimWnFaHGXZ9jaqUh7dc/qoFZnUlMRVg2+2VAo6tU u7tKal3EeILxvtEeEktBeDvHI/HubYky2w3nU2maFEamiQrrCnJOLtJPOkZIFxJGRp4M ATf9+6FZozlm7acg70CiXOojkYUz+9goI56Y53mgAwL23Df0VbJesmKfuOwYY/RSOEYH o3C57mxrlUvQZygbC9WZ6vNK184aXHaVUkSAxgB/EApjnWeZaFQsNG1buGL4yNvnzPe3 lRKg== X-Gm-Message-State: AOAM532U+0AzsYGkJWs/l7IZoph0NgGu2/+gqGn1XSdOY7VdW7FTVEle YmnjQ/eQpk9FGPfDn91g5EtGOCBE9ftfCQ== X-Received: by 2002:ad4:5aee:: with SMTP id c14mr7922342qvh.19.1630071012375; Fri, 27 Aug 2021 06:30:12 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id q184sm4865997qkd.35.2021.08.27.06.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 06:30:11 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mJbvv-005gvU-41; Fri, 27 Aug 2021 10:30:11 -0300 Date: Fri, 27 Aug 2021 10:30:11 -0300 From: Jason Gunthorpe To: Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, iommu@lists.linux-foundation.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, luto@amacapital.net, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com Subject: Re: [PATCH v4 14/14] tpm: Allow locality 2 to be set when initializing the TPM for Secure Launch Message-ID: <20210827133011.GJ1200268@ziepe.ca> References: <1630070917-9896-1-git-send-email-ross.philipson@oracle.com> <1630070917-9896-15-git-send-email-ross.philipson@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1630070917-9896-15-git-send-email-ross.philipson@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 09:28:37AM -0400, Ross Philipson wrote: > The Secure Launch MLE environment uses PCRs that are only accessible from > the DRTM locality 2. By default the TPM drivers always initialize the > locality to 0. When a Secure Launch is in progress, initialize the > locality to 2. > > Signed-off-by: Ross Philipson > --- > drivers/char/tpm/tpm-chip.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) Global state like this seems quite dangerous, shouldn't the locality be selected based on the PCR being accessed, or passed down from higher up in the call chain? Jason