Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1639468imj; Fri, 8 Feb 2019 05:03:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IaqvP+qU1UsDMDDfx/WdCcIoeniH8gd3YUiBPxNEHYv75HRapw+Dxv2pVVISb7MIcNV50iT X-Received: by 2002:a65:6294:: with SMTP id f20mr4450980pgv.174.1549630980313; Fri, 08 Feb 2019 05:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549630980; cv=none; d=google.com; s=arc-20160816; b=z1oU31jxA5flzgIrnXx4FBQLY8HSw6NvKgMOSR8xUwZtV/P0NR8O0Ip4giFQkCOdWw keuXtJ3UvqlObFzCHDQ4G42TX/1ph+wvE/tF15eEiP33THZ5Jlp3xO27U6ZRrUyhPmXX dBCi2UrXU/jwXkc+e7YpdhAkyRaTSD6r6TAZ7arM9QwbPE0ylZ8Zr/6fKeIF3U+EHfpX 8EAfBwGtq7dm3FYmuGL25vA5+xvO6O8ZjBgc9nOoaSpoFnFIQLQpQ7qCRU4/307yCZij +Ogiv2QPDROOyYXfDzXhIi6SiaQ/w3ngUOqFOBvOPW3UWzZftCDOwW18pln/p8f8oeSd trJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yFMiOCRN4048Vvp/bFcjv4NRRuszbAFjkReVNkWGgfc=; b=iHcYRcpONlaiJ2k0Jb9Pr49rwL/sDsBr5Cv4ceJU8AfQISgm7X1wKRi7Mwpl7tmiRt gqC+GH7k1VyBL4fBhN/bTO+3STohpbY8je0MY6x68jG1oSpH+nTmhtpZ3+X4AUcwmnGY JKVY2RUTiXHndVu7KavY+m8TPK/QSfmduDCXcoOW8uz80+ooSWtz2O4Rpxmt8EBYxYLE nu7Zd/uwi20uRmUbAP2EEfPs9Js27tebJT9IOC8sWPI5CLDqEPl9Mi0ahFkbUqkpoAUr Tn/DGEhS4cpH3x3iqxz8C3I4q5FiJrpvHVOYg4qIQ8+WZz4p2Lq15fYKnVMQq3yHcdVt RWkQ== 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 t184si2261234pfb.22.2019.02.08.05.02.41; Fri, 08 Feb 2019 05:03:00 -0800 (PST) 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 S1727174AbfBHNCc (ORCPT + 99 others); Fri, 8 Feb 2019 08:02:32 -0500 Received: from mga17.intel.com ([192.55.52.151]:5455 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbfBHNCb (ORCPT ); Fri, 8 Feb 2019 08:02:31 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2019 05:02:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,347,1544515200"; d="scan'208";a="145229707" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.115]) by fmsmga001.fm.intel.com with ESMTP; 08 Feb 2019 05:02:28 -0800 Date: Fri, 8 Feb 2019 15:02:27 +0200 From: Jarkko Sakkinen To: Stefan Berger Cc: Alexander Steffen , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Tomas Winkler , Tadeusz Struk , Stefan Berger , Nayna Jain Subject: Re: [PATCH v11 00/16] Remove nested TPM operations Message-ID: <20190208130227.GA16679@linux.intel.com> References: <20190205224723.19671-1-jarkko.sakkinen@linux.intel.com> <20190206120634.GA4680@linux.intel.com> <3d6fdcc1-8221-2137-fc82-596377cc2fdc@infineon.com> <20190207212912.GD23906@linux.intel.com> <0af40351-91d5-d0a7-2965-0a9c6505af79@linux.ibm.com> <20190208003314.GB7202@linux.intel.com> <1fbd29ad-1005-8450-4c39-00974468183b@linux.ibm.com> <20190208111442.GA11755@linux.intel.com> <06473b24-7c59-9405-bbe0-8d30b3450391@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06473b24-7c59-9405-bbe0-8d30b3450391@linux.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 08, 2019 at 07:05:26AM -0500, Stefan Berger wrote: > See my comment on [PATCH v11 08/16]. It needs to be added in that patch > since otherwise rc holds a non-zero value on function exit, which is wrong > at that point. The snippet in question: rc = chip->ops->send(chip, buf, count); if (rc < 0) { if (rc != -EPIPE) dev_err(&chip->dev, "%s: tpm_send: error %d\n", __func__, rc); return rc; } if (chip->flags & TPM_CHIP_FLAG_IRQ) goto out_recv; 'send()' ought to return zero on success case. This is how the snippet was before applying any patches scheduled for v5.1: rc = chip->ops->send(chip, buf, count); if (rc < 0) { if (rc != -EPIPE) dev_err(&chip->dev, "%s: tpm_send: error %d\n", __func__, rc); return rc; } if (chip->flags & TPM_CHIP_FLAG_IRQ) goto out_recv; Does not compute. /Jarkko