Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2050999imj; Fri, 8 Feb 2019 11:42:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IYeyDbKOGQz4uANs0cB8LMd08wbZRN+HfcBPfOH5BsJnbVr5J8Sr5AbS7YOr87uGnr7vnhH X-Received: by 2002:a62:e201:: with SMTP id a1mr23448999pfi.75.1549654935063; Fri, 08 Feb 2019 11:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549654935; cv=none; d=google.com; s=arc-20160816; b=ABHilQXRtiH12+27qRfDN9i3dTuZalp/KIMQi/13SU9vFQmFh3w8hFR9E3vBFmRDoN 5CQqYdKyE04cwtQYpbfTMFkjKTfqobc86LnDRXuh8bSfilYCR3mSwvP1ddcuTttbP8MN HHZkdqq6m89u2S2xgJQs0JEJ/l0caN/ajweiGtOjxq/89p9QFpFtWMf9kkZgnBy8WrCI jlO45k6IJFA1xRi5uPE4TKOUKGi6gMoIRGmSTEMbn7OeWNMrO3i5LUDUa1uFjOaQrlie 2xFiQHRrqpw4l8I1J67YgRGJsmCzp6GvyI9HYtu13xDITXFEuj9KTdaQ6X/vGkWISoIV lFfw== 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=N0qXoTUsVoGeTbSAGN49Uaqm0sQ0xlrUYnlFkLVJLGk=; b=aWd/DKE3LwlHRZjt8yEwljr//PM6UAFUKjhnvbRkx6ceSjvmz5+UEmRnTFaZ2BN1Ra l71cQm21e/fDlr9VH/NmabYgkm2GCQgPu5jRGMr1k1gGJlhB3NCgjEJJscdRXP0mopvJ fWO5NMbDo7YA+ma+AWjlahwZmtpRXfWyBf9NB989I1dkLPtCRu+a97RwDei/Fj0V27VE KSxZMFkOpIe+qy/CXsN+LBAar2nsfzDVJK2Y7Xp1V081GbaJnO45N2L5zk8SQnAXPRJm s7wqsqHD2EWSXBjdCxgQhwVQQnbYUciEJQlXssGemp1hGwW4KB7Ee3WIf4kmRGZrAJbF FtyA== 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 w16si3302762plk.192.2019.02.08.11.41.53; Fri, 08 Feb 2019 11:42:15 -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 S1727341AbfBHTRS (ORCPT + 99 others); Fri, 8 Feb 2019 14:17:18 -0500 Received: from mga09.intel.com ([134.134.136.24]:60147 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfBHTRR (ORCPT ); Fri, 8 Feb 2019 14:17:17 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2019 11:17:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,348,1544515200"; d="scan'208";a="121021449" Received: from szilberm-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.172]) by fmsmga007.fm.intel.com with ESMTP; 08 Feb 2019 11:17:11 -0800 Date: Fri, 8 Feb 2019 21:17:10 +0200 From: Jarkko Sakkinen To: Stefan Berger Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Peter Huewe , Jason Gunthorpe , Stefan Berger , Alexander Steffen , stable@vger.kernel.org Subject: Re: [PATCH v4 1/2] tpm: =?iso-8859-1?Q?Uni?= =?iso-8859-1?Q?fy_the_send_callback_behaviour=E4?= Message-ID: <20190208191710.GA30645@linux.intel.com> References: <20190208180857.12330-1-jarkko.sakkinen@linux.intel.com> <20190208180857.12330-2-jarkko.sakkinen@linux.intel.com> <4072b2b6-0f95-be50-0772-7e2869c2c24e@linux.ibm.com> <20190208190057.GA3439@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208190057.GA3439@linux.intel.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 09:00:57PM +0200, Jarkko Sakkinen wrote: > It all looks now legit, but just in case I'll add a check for the return > value to tpm_try_transmit() and a warning if it is not zero in the > success case (and after that zeroing of rc). Now the commits are applied both master and next, and these are the checks for send(): rc = chip->ops->send(chip, buf, count); if (rc < 0) { if (rc != -EPIPE) dev_err(&chip->dev, "%s: send(): error %d\n", __func__, rc); return rc; } /* A sanity check. send() should just return zero on success e.g. * not the command length. */ if (rc > 0) { dev_warn(&chip->dev, "%s: send(): invalid value %d\n", __func__, rc); rc = 0; } Should be fairly safe play now. /Jarkko