From: Jason Gunthorpe Subject: Re: [PATCH v2] tpm: Check size of response before accessing data Date: Thu, 12 Jan 2017 10:18:39 -0700 Message-ID: <20170112171839.GB12257@obsidianresearch.com> References: <1484079341-22088-1-git-send-email-stefanb@linux.vnet.ibm.com> <20170112144321.xctny56r4vqfdekg@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170112144321.xctny56r4vqfdekg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jarkko Sakkinen Cc: linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Thu, Jan 12, 2017 at 04:43:21PM +0200, Jarkko Sakkinen wrote: > On Tue, Jan 10, 2017 at 03:15:41PM -0500, Stefan Berger wrote: > > Make sure that we have not received less bytes than what is indicated > > in the header of the TPM response. Also, check the number of bytes in > > the response before accessing its data. > > > > Signed-off-by: Stefan Berger > > I'm not going to take this. Do the check case by case outside > of tpm_trasmit_cmd. What? Why on earth would you do that? Every caller needs this validation, it makes sense to make it mandatory. Jason ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi