From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbcFVKyh (ORCPT ); Wed, 22 Jun 2016 06:54:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:27940 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbcFVKyg (ORCPT ); Wed, 22 Jun 2016 06:54:36 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,509,1459839600"; d="scan'208";a="126561757" Date: Wed, 22 Jun 2016 13:46:12 +0300 From: Jarkko Sakkinen To: Ed Swierk Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Jason Gunthorpe , Stefan Berger Subject: Re: [PATCH v7 3/5] tpm: Clean up reading of timeout and duration capabilities Message-ID: <20160622104612.GA24754@intel.com> References: <1465610107-87762-1-git-send-email-eswierk@skyportsystems.com> <1466474042-110773-1-git-send-email-eswierk@skyportsystems.com> <1466474042-110773-4-git-send-email-eswierk@skyportsystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 21, 2016 at 05:21:27PM -0700, Ed Swierk wrote: > On Mon, Jun 20, 2016 at 6:54 PM, Ed Swierk wrote: > > --- a/drivers/char/tpm/tpm-interface.c > > +++ b/drivers/char/tpm/tpm-interface.c > > @@ -461,9 +461,19 @@ ssize_t tpm_getcap(struct device *dev, __be32 subcap_id, cap_t *cap, > > tpm_cmd.params.getcap_in.subcap_size = cpu_to_be32(4); > > tpm_cmd.params.getcap_in.subcap = subcap_id; > > } > > + > > rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, desc); > > + > > + if (!rc && > > + ((subcap_id == TPM_CAP_PROP_TIS_TIMEOUT && > > + be32_to_cpu(tpm_cmd.header.out.length) != TPM_HEADER_SIZE + 5) || > > + (subcap_id == TPM_CAP_PROP_TIS_DURATION && > > + be32_to_cpu(tpm_cmd.header.out.length) != TPM_HEADER_SIZE + 4))) > > + rc = -EINVAL; > > + > > Woops, a totally innocuous last-minute (post-testing) cleanup broke > this code; should be TPM_HEADER_SIZE + 20 and + 16. I'll push out v8 > as soon as I redo my tests. OK, that's cool. Haven't yet got into testing it anyway. 1. This is too late for 4.8 release. 2. I'm on four week leave starting from week after next week but before I go to my leave I will apply these commits to my master branch so that they get exposure. 3. I try to do testing for my part before going to the leave. > --Ed /Jarkko