Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2016007imj; Fri, 8 Feb 2019 11:03:05 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia52nAyfUfqhmIXw+JoESullZCFSa4BMUIAmmwhfHF8S/5srsS/TZBZiS3wOoPh4S8wXzoV X-Received: by 2002:a65:63d3:: with SMTP id n19mr22083539pgv.179.1549652585491; Fri, 08 Feb 2019 11:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549652585; cv=none; d=google.com; s=arc-20160816; b=Okl1P0ciGB9pUkdkYjQhPMaH2KsQQ6rzPmTX7iYC7EEQecypZShJXv6C/PUAh8ryUs Jlh9NuYx4QYi4rEq4JoSIUec92F2IKql4i47+bQB7xGR+upZxLql/ouhDxX8PEGG/Tvn E1QNSiJVZ4xzeyIIOVTKO6uR6EJyKc9lzvrBDtGgMPMF5uAWKs8hUDiDq3Kb9vqfEAbY 0+Ki7e5Y0MAVcMVIYh7jXueinBDBJV9lU7W0uLwVJ1HECYjO+9zh4POp+EIBXJA9YXbq oVk1U3t2YDxuNq6j0c2VHGEjQabBUasRljbNFwI681U25tBNunkqBKkBYXQ6QSHJMv8Q RyhA== 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=7H+gwU0w3fb0ZImPzrLuUbVArvu0pdrt4/B+xUcx/fc=; b=1JPelurKw6/5kiqBOXioXad5rawdmV9IiIgxlmPjyZ9cuowpA4m6lrEmBDWZH1sjvQ chDjvVjT8234xp9gBE+ETX/C1Ev+sHr+0SQYwPmVUs3nig5LpIV92ebAosQqXLF1WBLC c5RMYsZXx3pXG8dYjw50MYfyob95i5WHGpNw4Uum9xXBlqlseBX0Q8+CuyGrBwNtiAuU H6gK9o04zPLCnjfXvSoAIQ6DQndG4FIPMJWypqitI8ONE6cV6K+8+cTov+0cKxekZywo haHbZDVJyBXQiIJ1wTJ2hyfXrO83C++z0wvryThcLZkmPoq3iqdkrg7SNHmlrWowgttc 6c3g== 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 27si3051841pgp.135.2019.02.08.11.02.49; Fri, 08 Feb 2019 11:03:05 -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 S1727348AbfBHTBF (ORCPT + 99 others); Fri, 8 Feb 2019 14:01:05 -0500 Received: from mga12.intel.com ([192.55.52.136]:33385 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfBHTBE (ORCPT ); Fri, 8 Feb 2019 14:01:04 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2019 11:01:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,348,1544515200"; d="scan'208";a="141845693" Received: from szilberm-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.172]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2019 11:00:58 -0800 Date: Fri, 8 Feb 2019 21:00:57 +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: Unify the send callback behaviour Message-ID: <20190208190057.GA3439@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4072b2b6-0f95-be50-0772-7e2869c2c24e@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 01:12:34PM -0500, Stefan Berger wrote: > On 2/8/19 1:08 PM, Jarkko Sakkinen wrote: > > The send() callback should never return length as it does not in every > > driver except tpm_crb in the success case. The reason is that the main > > transmit functionality only cares about whether the transmit was > > successful or not and ignores the count completely. > > > > Cc: stable@vger.kernel.org > > Signed-off-by: Jarkko Sakkinen > > Reviewed-by: Stefan Berger > > Let me know when you put it into your tree, I'll give it a spin while I am > at it. :-) Thank you Stefan! I also add your suggested-by to the first commit because you pointed out the problem. 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). That check can be removed when I do v5.3 pull request. That should enough window to catch any potential issues and check will ensure that kernel won't fail even there was something forgotten. Alexander, I'll push this version now to the master and next with the additional check described in this commit, but will add your tags after you have time to test. Thanks alot! /Jarkko