Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1249220imm; Wed, 17 Oct 2018 16:24:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV61xnYf9HbZ6I6tZxaErRsDLiETnH5VDCt+DQB9kALyYe+HZKgIEn5yZetUy1LBn51pMC5B+ X-Received: by 2002:a17:902:48:: with SMTP id 66-v6mr27874473pla.7.1539818649943; Wed, 17 Oct 2018 16:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539818649; cv=none; d=google.com; s=arc-20160816; b=V6HUdRfBgzQ0R1TH6s7NJiyYtLbf7ogiLN9eLI5C0Yr6/diHxkXIcaf7p92ZiF/r6e 3ZwfYWWVlW2TqrQvjJd9qXmeD5qNVxzJNaR8Fnq56x9JPFSlNAtjBQs+CBj6VRFo7SSN oFGYUM+xa35yGLyTlZpusAm/YoGOJmOPaG11Gm6xsWmPk99orkmRe0gy0p7DZwe/OlvV JPrCuq902ztS/49+vBpwLiyK0Q6cpuRXMtHSuy/lAqtMggEsWTlfdHRK/e3qjZGJ5WQy ui01pxXorgnuqmK7ixa8/b0b2mBceV20XYCq4jkDlbl65OiEjBKVspi0BbzEZwKQl9Vc VFgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=zWZYDlP2PWYdpf3iFY96COQ4fFDR/GVBsfyinjZSioA=; b=Spn/5YzECQKERQPQpkLjMQ7zK48EMO6mSdvdmlLKbYZXVJpDYyoO1YuLauJd+pOgM3 edQ5//SADoC2Vbor4zqW/eqYUb9QXyxrdZvAZTpF/aqg6r3PaE1C0Lp6nlf4C15Gz3vZ MJhkTUfKowSeHLGunS7DYRb0et2i/0F5ximCFffCJh5J6HZuLmwoxPcvSHc5SoJbJHG2 OpV5i4p2lLPo6cqYG+Ynz2kXiSwfJJ2uBo8JsTcyAfS0Vk/+Q+jd3LMjIrUhPbUhD1ZW 1jC8m/mk5PjZmxB3Hvz3hc79H47MMHUI1LBKDXnIDW3joBsr4iUfqD/ku8Wx+ao1PNG6 ZiVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si17457727pld.281.2018.10.17.16.23.54; Wed, 17 Oct 2018 16:24:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727488AbeJRHGr convert rfc822-to-8bit (ORCPT + 99 others); Thu, 18 Oct 2018 03:06:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:51969 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbeJRHGr (ORCPT ); Thu, 18 Oct 2018 03:06:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 16:08:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,393,1534834800"; d="scan'208";a="83479894" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 17 Oct 2018 16:08:49 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Oct 2018 16:08:49 -0700 Received: from hasmsx106.ger.corp.intel.com (10.184.198.20) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Oct 2018 16:08:49 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.28]) by HASMSX106.ger.corp.intel.com ([169.254.10.144]) with mapi id 14.03.0319.002; Thu, 18 Oct 2018 02:08:46 +0300 From: "Winkler, Tomas" To: Jarkko Sakkinen CC: Jason Gunthorpe , Nayna Jain , "Usyskin, Alexander" , "Struk, Tadeusz" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Thread-Topic: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Thread-Index: AQHUZm1STDh1wH1FgU+vrAhOzJfWh6UkD5xw Date: Wed, 17 Oct 2018 23:08:46 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9D9F52A9@hasmsx109.ger.corp.intel.com> References: <20181015111434.7777-1-tomas.winkler@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWJkYzRiM2EtMWVmYi00OGVjLTk2MmUtMmZiNDgyZGM3NGI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicEo5TjhrSjA3QVpHSE9mQ0Y2YkVIanlkY1pmRFRzbEQ1c3A2Q3lvdVU5R0h3VGVLVDRNZm03TUY0WHlTR2V4VSJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.12.116.154] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Jarkko Sakkinen [mailto:jarkko.sakkinen@linux.intel.com] > Sent: Thursday, October 18, 2018 02:01 > To: Winkler, Tomas > Cc: Jarkko Sakkinen ; Jason Gunthorpe > ; Nayna Jain ; Usyskin, > Alexander ; Struk, Tadeusz > ; linux-integrity@vger.kernel.org; linux-security- > module@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() > > On Mon, 15 Oct 2018, Tomas Winkler wrote: > > Ignore the return value of go_to_idle() in tpm_try_transmit(). > > Once it may shadow the return value of actual tpm operation, second > > the consequent command will fail as well and the error will be caought > > anyway. > > Last fix wrong goto, that jumped back instead of forward. > > > > Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from > > runtime_pm") > > Signed-off-by: Tomas Winkler > > --- > > drivers/char/tpm/tpm-interface.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/char/tpm/tpm-interface.c > > b/drivers/char/tpm/tpm-interface.c > > index 129f640424b7..f69c711bf74a 100644 > > --- a/drivers/char/tpm/tpm-interface.c > > +++ b/drivers/char/tpm/tpm-interface.c > > @@ -547,9 +547,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip > *chip, > > dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc); > > > > out: > > - rc = tpm_go_idle(chip, flags); > > - if (rc) > > - goto out; > > + (void)tpm_go_idle(chip, flags); > > > > if (need_locality) > > tpm_relinquish_locality(chip, flags); > > -- > > 2.14.4 > > > > > > LGTM. Should be probably Cc'd to stable (can add). > > Reviewed-by: Jarkko Sakkinen I've posted another one, there are more issues in the flow.