From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Berger Subject: Re: [PATCH RFC 2/4] tpm: validate TPM 2.0 commands Date: Mon, 9 Jan 2017 17:39:43 -0500 Message-ID: <9e146d67-2981-c440-731e-cd049cf588e9@linux.vnet.ibm.com> References: <20170102132213.22880-1-jarkko.sakkinen@linux.intel.com> <20170102132213.22880-3-jarkko.sakkinen@linux.intel.com> <1483553976.2561.38.camel@linux.vnet.ibm.com> <1483556735.2561.53.camel@linux.vnet.ibm.com> <20170109221700.q7tq362rd6r23d5b@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170109221700.q7tq362rd6r23d5b-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 , Stefan Berger Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, James Bottomley List-Id: tpmdd-devel@lists.sourceforge.net On 01/09/2017 05:17 PM, Jarkko Sakkinen wrote: > On Wed, Jan 04, 2017 at 02:22:45PM -0500, Stefan Berger wrote: >> James Bottomley wrote on 01/04/2017 02:05:35 PM: >> >> > From: James Bottomley >> > To: Stefan Berger/Watson/IBM@IBMUS >> > Cc: Jarkko Sakkinen , tpmdd- >> > devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Jason Gunthorpe >> >> > Date: 01/04/2017 02:05 PM >> > Subject: Re: [tpmdd-devel] [PATCH RFC 2/4] tpm: validate TPM 2.0 >> commands >> > >> > On Wed, 2017-01-04 at 13:59 -0500, Stefan Berger wrote: >> > > [ 67.699811] WARNING: CPU: 12 PID: 870 at mm/page_alloc.c:3511 >> > >> > What's the code context around this line in your source? Or what >> > kernel version? If it's this >> > >> > if (order >= MAX_ORDER) { >> > WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)); >> > return NULL; >> > } >> > >> >> I am running Jarkko's tree, the tabrm branch. 4.9.0-rc5 I think. I have >> exactly what you are showing above. >> > Then I think you may have returned bogus data to TPM_PT_TOTAL_COMMANDS; >> > perhaps print nr_commands. >> >> Ha, what is likely the cause here is that the test suite, which implements >> only a few commands to respond to the kernel with from the vtpm proxy >> side, isn't feeding good data to the driver and the nr_commands ends up >> being 0... or actually bogus data / not initialized. I guess the function >> should check for valid input. > So, what kind of validation do you suggest? Checking it whether it is > zero? Out of bounds. > 0x200, < 0x01 Stefan ------------------------------------------------------------------------------ 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