Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2184847imm; Thu, 11 Oct 2018 06:30:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV63PkGJM78GeA5D+vD/e+Pm/ifpAbyRYJ7b14D9t2TnsuMnvRxcfOpUAW7n88tq4bHEPixcW X-Received: by 2002:a62:c42:: with SMTP id u63-v6mr1616058pfi.43.1539264648565; Thu, 11 Oct 2018 06:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539264648; cv=none; d=google.com; s=arc-20160816; b=GuwGPOk5vlb4RkXdjKaW8qK77gzuiSc/IlnuFbFPe662mZHZHoddAJhz2F9eEF9pEd 0js3sohDxN+8sY3OKIu1K455weUMszff1JF8619TMU+yuRRCozEmWqcIHpYjC7CVTYwD IPDSH0FsmbC4Z4jpF/U2q4UGWU/AVkr4uU65RV3LPkSsEMHy0H0GfPbbZNUR9N10X5AU p9KVXlVuaAC9b4iRaRdWdTH4dYKr1EbCPRMom8MaJovs8KotYdEBN51a7Bx13YrPhejT 0AvcS5IXRUqaoNbIzyRuXotWcM7ATMfHwh8yAxuTj8aqAH7hC3fDpaY6F90wElD9LI5A UVzg== 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=xtNtZUAY90gfff3L4lNclHxmRkk8jAvks71WvvWJwtM=; b=wrt6baUz8+CdHQw8z/KlQGvL5DhfnwkDnj9xm+NmyOSoXxLlohqst+pqcTnLhbZlYQ Dda0QPIOYrBnK3DEBV1bEcqiey8+f6dTLHLsUyJVKxUsA3U9NU1wYBy0zE3lSWm8WF3l V+6EHN8Q7//m+ye1YimUyjLG7e7UK3tGLBhA9s3UdVd7PNGdqFNi2HoLPHlXVmizzGtV e1GLC7h7vP6W8ARD0HaXTeWWvx2MHppXKaREcRlUtuegpAlzYfLdAgIHER9kchEm1KFy LXJVdt3tYosz9TOblaw03Dhzk8ZRFm4tuXpYirFKGls+rBq7yAxBne9oq6iXy+Eoh3jQ rjKQ== 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 c81-v6si255982pfb.153.2018.10.11.06.30.33; Thu, 11 Oct 2018 06:30:48 -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 S1727758AbeJKUzO convert rfc822-to-8bit (ORCPT + 99 others); Thu, 11 Oct 2018 16:55:14 -0400 Received: from mga06.intel.com ([134.134.136.31]:21241 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbeJKUzO (ORCPT ); Thu, 11 Oct 2018 16:55:14 -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 orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 06:28:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,368,1534834800"; d="scan'208";a="91126945" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 11 Oct 2018 06:27:59 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 Oct 2018 06:28:00 -0700 Received: from lcsmsx154.ger.corp.intel.com (10.186.165.229) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 Oct 2018 06:27:59 -0700 Received: from HASMSX109.ger.corp.intel.com ([169.254.3.28]) by LCSMSX154.ger.corp.intel.com ([169.254.7.171]) with mapi id 14.03.0319.002; Thu, 11 Oct 2018 16:27:59 +0300 From: "Winkler, Tomas" To: Jarkko Sakkinen , Jason Gunthorpe CC: "Gustavo A. R. Silva" , Peter Huewe , Arnd Bergmann , Greg Kroah-Hartman , "linux-integrity@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] tpm: fix unused-value issues in tpm_try_transmit Thread-Topic: [PATCH] tpm: fix unused-value issues in tpm_try_transmit Thread-Index: AQHUYJ6p/SuLBw4aaUml2bYnZz2LwqUYUWMAgAFvawCAADdeYA== Date: Thu, 11 Oct 2018 13:27:58 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B9D9EEC12@hasmsx109.ger.corp.intel.com> References: <20181010133817.GA11485@embeddedor.com> <20181010140638.GA3894@ziepe.ca> <20181011120140.GA15767@linux.intel.com> In-Reply-To: <20181011120140.GA15767@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTgyMTEyYmItZDc3OS00OThjLTg2NDItN2FiYzk1ODdkZTY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ0pDeTM3eFNMWm44VW5rdFYyZ0hpTG1GVkVWUDRKVVl4eGVSeldVU2VlSmdPZG1nQ2VSNG5MWTVER095UEdhRCJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.12.116.95] 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 Wed, Oct 10, 2018 at 08:06:38AM -0600, Jason Gunthorpe wrote: > > On Wed, Oct 10, 2018 at 03:38:17PM +0200, Gustavo A. R. Silva wrote: > > > Currently, there are some values assigned to variable *rc*, which > > > are never actually used in any computation, because such variable is > > > updated at line 550, before they can be used: > > > > > > 549out: > > > 550 rc = tpm_go_idle(chip, flags); > > > 551 if (rc) > > > 552 goto out; > > > > > > Fix this by removing such assignments. > > > > Should this be done by not quashing rc during the error unwind rather > > than dropping the errors? > > Yeah.` > > Wondering if tpm_go_idle() should simply be a void-function i.e. issue just a > warning inside (disclaimer: did not revisit its code when writing this). We did have rather a long discussion about it when it was merged. There are two flows that may crash rc = tpm2_commit_space() but you still can need to rc = go_idle() which also may crash which may override the previous value. Frankly the second one is fatal, the stack will go out of sync. We may do void here as the stack will crash in a subsequent command. The 'goto out' is quite a bug, probably caused by code movement. Thanks Tomas