Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp649155ima; Sat, 20 Oct 2018 15:50:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5elsm8Qc3mWjpLjA2Co8NGSQ8CkiWDnIjFkPu6qKsI0ZCE39IphNo+t6gmm0Ne1pHxskc9L X-Received: by 2002:a63:4617:: with SMTP id t23-v6mr112489pga.197.1540075826747; Sat, 20 Oct 2018 15:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540075826; cv=none; d=google.com; s=arc-20160816; b=KFAvyzRbOFXdgH7UVUPShVPYF/TTaLqHBa7B28Gg73yPlDqWrMEOGTzlav9pnrBznV pUOWFqVJLd5FDeD0JWmbTfo42YMpwz/7rnDlW6vDdRwifRQgeuuN762W0djZF5hAQN4l hTtJ4Z828GF17tSb1VwYhcj0a7TrWnXkvUxvZGG5BHNTaPMO6AinfQItv+wm8gCxwVR9 cf0U6CZ3uKlAA76KzFzObh2FuRtrgja6ZkViUMyX114YXUdDbWQFIPVm9/N1n3hBfAqa +RA28DINzwrpF4UtEreVkgoQ6tcdD9mwV6EFcoZdCxZCBPaZbcVLKqxdBmiGuqTWNmPu +AGg== 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=mEAHUq8oYeiYVoDTRunbd6x2puLbwDt7S05F2UGwtDg=; b=l86OmxwUjjx+xwv354rnJ5B97rmojKGZJD9tMMCRJWavfrqsFjgmEPrAAM5BGhJUZx 1PbAWnxjw+oQ4LIBL9mXCEfsqVi4juSzqgpVDKZzENBZWWICkG8BVgg6nBS78AZnjfIr M7FgO9V4Pn6YyCvIx0OxVgnKKvrapGTYKGjHLA7Vo5M/87ghAYsszjQTvqezFQQxTYz9 /dI7A1Og9pPkkreil4xUCGDZnIUK0fDYkws91O2n5vq1ogGtH8CLuTuP0/6uKaSp2Vig +kFxKDJxF82/USbdikEdzlIyKB8vgswQ/lCh8/SW/t9RU3lmhnIG/bjsttUx2e3yabDy LxkA== 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 o7-v6si4205659pll.20.2018.10.20.15.50.12; Sat, 20 Oct 2018 15:50:26 -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 S1726842AbeJUHBt convert rfc822-to-8bit (ORCPT + 99 others); Sun, 21 Oct 2018 03:01:49 -0400 Received: from mga09.intel.com ([134.134.136.24]:58913 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbeJUHBt (ORCPT ); Sun, 21 Oct 2018 03:01:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2018 15:49:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,405,1534834800"; d="scan'208";a="93669074" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 20 Oct 2018 15:49:44 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 20 Oct 2018 15:49:44 -0700 Received: from hasmsx107.ger.corp.intel.com (10.184.198.27) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 20 Oct 2018 15:49:44 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.28]) by hasmsx107.ger.corp.intel.com ([169.254.2.223]) with mapi id 14.03.0319.002; Sun, 21 Oct 2018 01:49:41 +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" , "stable@vger.kernel.org" Subject: RE: [PATCH] tpm: tpm_try_transmit() refactor error flow. Thread-Topic: [PATCH] tpm: tpm_try_transmit() refactor error flow. Thread-Index: AQHUZneRpMm4aXcqcE6txCcRpwrMbKUkg60wgAKFoACAAbSoMA== Date: Sat, 20 Oct 2018 22:49:40 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9D9F85F5@hasmsx109.ger.corp.intel.com> References: <20181016133716.17842-1-tomas.winkler@intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9D9F5512@hasmsx109.ger.corp.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjYwYjJhYjQtN2NlYi00YWUxLWFmYWItNDc0MzE4YzUyYjg3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQ29EV3pPM2Nld3V2aWJcL21mV1RsMnJ5QkQ3NGt3OENlRGRxMmp6VW5ubXpVZUtRdFNtbWVPcUhuanpqaGxKZ2EifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.249.90.242] 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 > > On Thu, 18 Oct 2018, Winkler, Tomas wrote: > >> -----Original Message----- > >> From: Jarkko Sakkinen [mailto:jarkko.sakkinen@linux.intel.com] > >> Sent: Thursday, October 18, 2018 03:15 > >> 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; > >> stable@vger.kernel.org > >> Subject: Re: [PATCH] tpm: tpm_try_transmit() refactor error flow. > >> > >> On Tue, 16 Oct 2018, Tomas Winkler wrote: > >>> First, rename out_no_locality to out_locality for bailing out on > >>> both > >>> tpm_cmd_ready() and tpm_request_locality() failure. > >> > >> This is unnecessary change and technically it is not a rename: the > >> commit message text and the code change do not match. Rename is just > >> a rename (i.e. change a variable name foo to bar). > > > > I'm renaming the label because it doesn't match the code flow anymore, > > I can change the commit message, but you please review the code. > > Tomas > > The flow change is unnecessary and does not really have anything to do with > the bug fix. What I see in the original code is that when tpm_cmd_ready() fails it's jumps to 'out' label and trying to do tpm_go_idle() but instead it should just undoing the locality, so both cmd_read and go idle had a wrong jump. I see both should be fixed. Earlier version was better than this and would have been fine > when taking account the remark from Jason.