Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp195061ybm; Wed, 27 May 2020 23:55:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC9U7c1X4f3YBHtVFiFBSQHjXUEWsEc2dKEbYZL1Jd7YK0sZrtFmKKCAXUzaCHiVYZUKQS X-Received: by 2002:a50:ee8e:: with SMTP id f14mr1567492edr.115.1590648944912; Wed, 27 May 2020 23:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590648944; cv=none; d=google.com; s=arc-20160816; b=GNAvbPF6MbCMGdB2c/UZxUUXHY9rqx3iQ8iaWCwob31xhjOq7lnhmvNhMqQBls2NC0 JEuLLK6cDWGbfzA+cTBtEiJrgwu17Pg210l6l29/aC4ZUDSZaqMt30MHr7xbpTAGRmRM e2N+uVF0CoG8pm86tXZPQj74eRehIuNVAGqLtszkmh5nVwwyu1wuRcyu0iQXugWTbLo8 ZkmviCSC6MemlYWpEoTndZ7A3LG7U1dDASz3ZLC2WGvNAnQ/jGt2lXwexC9I9UJNg/uF OdgBcAWH9z7EKXEJLeSrzMD6UM8VBeV5YMtQnTWpb4S5JSjbk7m+LENISxg9pGvBvwDG d59g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=7Cy0T24TqSL8z3aWsyLLg1yi9OrCB/TYycl60LI1YFY=; b=UYpmmlDRyqJd8KauQOMf6R48+xkdHYYKq7x3IzFLVhUI1bXmSl3PejcuTBOCz44vQS mexpPr1gGVrXHZ6JtqjY0AK5QgoV2yyOFeCETh4G18MDkqXJdtDE9Qn5/iV9HfRFl1fX aHAG/vFICZDBzgwmN5qotpjS2tm9oe9GB0cuySVgz2bczS6BP8Hvaw4kNAhF3R7PS3xL rQfh9CAI8eZtJw4ODYO1fck1vRsNO/VZ/2n4GJVkTGLhxSUAzU0rnuHA7cJ5zOnrjv2Y HJp01A5Ej2DSSCJuv3YSRTQtm9kWrdOj+Pw0xdj6yXCrtqdrQJN3OFI2F6yMdFpW3xK0 tWkg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci9si813031ejb.218.2020.05.27.23.55.22; Wed, 27 May 2020 23:55:44 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725914AbgE1Gx2 (ORCPT + 99 others); Thu, 28 May 2020 02:53:28 -0400 Received: from mga01.intel.com ([192.55.52.88]:23208 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbgE1Gx1 (ORCPT ); Thu, 28 May 2020 02:53:27 -0400 IronPort-SDR: NNwGzALuLadW46pYPgXiwVTJiHBFuRKVkx/orZqhK6vh1Aqhz4qIVjBUESS3meItjAuoy6mufm RTTjkHJE1r9g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2020 23:53:26 -0700 IronPort-SDR: cSjsHPnMl5vLuW8G07ZkXD/BD6WGOI6Ax5qbqEpy415U8PtCxcSPIVqf9U9nXFtrsAXn9ogjz6 FyYEI5sKHMqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,443,1583222400"; d="scan'208";a="267116960" Received: from dmescala-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.59.102]) by orsmga003.jf.intel.com with ESMTP; 27 May 2020 23:53:20 -0700 Date: Thu, 28 May 2020 09:53:18 +0300 From: Jarkko Sakkinen To: Mario.Limonciello@dell.com Cc: James.Bottomley@HansenPartnership.com, peterhuewe@gmx.de, jgg@ziepe.ca, arnd@arndb.de, gregkh@linuxfoundation.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, jeffrin@rajagiritech.edu.in, alex@guzman.io Subject: Re: [PATCH] tpm: Revert "tpm: fix invalid locking in NONBLOCKING mode" Message-ID: <20200528065318.GC188849@linux.intel.com> References: <20200526183213.20720-1-mario.limonciello@dell.com> <1590520454.11810.40.camel@HansenPartnership.com> <1590521924.15108.1.camel@HansenPartnership.com> <37da2695fe6de09d69e27b77f3e29e068596205f.camel@linux.intel.com> <4d1a53596af44c7b84f97aa4ce04a53c@AUSX13MPC105.AMER.DELL.COM> <20200528004355.GA5877@linux.intel.com> <7072116bf16a45bca62913e7d8a0354e@AUSX13MPC105.AMER.DELL.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7072116bf16a45bca62913e7d8a0354e@AUSX13MPC105.AMER.DELL.COM> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 12:59:59AM +0000, Mario.Limonciello@dell.com wrote: > > > > [EXTERNAL EMAIL] > > > > What is this? > > Something my employer's mail system automatically tags in external email. > > My mistakes in forgetting to remove it on the response. NP, just asking :-) > > > > On Tue, 2020-05-26 at 12:38 -0700, James Bottomley wrote: > > > > > On Tue, 2020-05-26 at 19:23 +0000, Mario.Limonciello@dell.com wrote: > > > > > > > On Tue, 2020-05-26 at 13:32 -0500, Mario Limonciello wrote: > > > > > > > > This reverts commit d23d12484307b40eea549b8a858f5fffad913897. > > > > > > > > > > > > > > > > This commit has caused regressions for the XPS 9560 containing > > > > > > > > a Nuvoton TPM. > > > > > > > > > > > > > > Presumably this is using the tis driver? > > > > > > > > > > > > Correct. > > > > > > > > > > > > > > As mentioned by the reporter all TPM2 commands are failing with: > > > > > > > > ERROR:tcti:src/tss2-tcti/tcti- > > > > > > > > device.c:290:tcti_device_receive() > > > > > > > > Failed to read response from fd 3, got errno 1: Operation not > > > > > > > > permitted > > > > > > > > > > > > > > > > The reporter bisected this issue back to this commit which was > > > > > > > > backported to stable as commit 4d6ebc4. > > > > > > > > > > > > > > I think the problem is request_locality ... for some inexplicable > > > > > > > reason a failure there returns -1, which is EPERM to user space. > > > > > > > > > > > > > > That seems to be a bug in the async code since everything else > > > > > > > gives a ESPIPE error if tpm_try_get_ops fails ... at least no-one > > > > > > > assumes it gives back a sensible return code. > > > > > > > > > > > > > > What I think is happening is that with the patch the TPM goes > > > > > > > through a quick sequence of request, relinquish, request, > > > > > > > relinquish and it's the third request which is failing (likely > > > > > > > timing out). Without the patch, the patch there's only one > > > > > > > request,relinquish cycle because the ops are held while the async > > > > > > > work is executed. I have a vague recollection that there is a > > > > > > > problem with too many locality request in quick succession, but > > > > > > > I'll defer to Jason, who I think understands the intricacies of > > > > > > > localities better than I do. > > > > > > > > > > > > Thanks, I don't pretend to understand the nuances of this particular > > > > > > code, but I was hoping that the request to revert got some attention > > > > > > since Alex's kernel Bugzilla and message a few months ago to linux > > > > > > integrity weren't. > > > > > > > > > > > > > If that's the problem, the solution looks simple enough: just move > > > > > > > the ops get down because the priv state is already protected by the > > > > > > > buffer mutex > > > > > > > > > > > > Yeah, if that works for Alex's situation it certainly sounds like a > > > > > > better solution than reverting this patch as this patch actually does > > > > > > fix a problem reported by Jeffrin originally. > > > > > > > > > > > > Could you propose a specific patch that Alex and Jeffrin can perhaps > > > > > > both try? > > > > > > > > > > Um, what's wrong with the one I originally attached and which you quote > > > > > below? It's only compile tested, but I think it will work, if the > > > > > theory is correct. > > > > > > > > Please send a legit patch, thanks. > > > > > > > > /Jarkko > > > > > > Jarkko, > > > > > > After the confirmation from Alex that this patch attached to the end of the > > thread > > > worked, James did send a proper patch that can be accessed here: > > > https://lore.kernel.org/linux- > > integrity/20200527155800.ya43xm2ltuwduwjg@cantor/T/#t > > > > > > Thanks, > > > > Hi thanks a lot! I did read the full discussions and agree with the > > conclusions as I get a patch in proper form. > > > > Please ping next time a bit earlier. It's not that I don't want to deal > > with the issues quickly as possible. It's probably just that I've forgot > > something or missed. > > > > /Jarkko > > Thanks! > > I completely forgot about it too, it was mentioned to me right after holidays > and I forgot to follow up and see that it got sorted. Yeah, sure, lets try to get a fix landed asap :-) /Jarkko