[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181108230749.GB8038@linux.intel.com>
Date: Fri, 9 Nov 2018 01:07:49 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: "Winkler, Tomas" <tomas.winkler@...el.com>
Cc: "linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
James Bottomley <James.Bottomley@...senPartnership.com>,
"Struk, Tadeusz" <tadeusz.struk@...el.com>,
Stefan Berger <stefanb@...ux.vnet.ibm.com>,
Nayna Jain <nayna@...ux.ibm.com>,
Peter Huewe <peterhuewe@....de>,
Jason Gunthorpe <jgg@...pe.ca>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 09/17] tpm: move tpm_validate_commmand() to
tpm2-space.c
On Thu, Nov 08, 2018 at 05:03:29PM +0000, Winkler, Tomas wrote:
> You initialized cc under if only
> > +
> > + i = tpm2_find_cc(chip, cc);
> > + if (i < 0) {
> > + dev_dbg(&chip->dev, "0x%04X is an invalid
> > command\n",
> > + cc);
> > + return -EOPNOTSUPP;
> > + }
> > +
> > + attrs = chip->cc_attrs_tbl[i];
> > + nr_handles =
> > + 4 * ((attrs >> TPM2_CC_ATTR_CHANDLES) &
> > GENMASK(2, 0));
> > + if (len < TPM_HEADER_SIZE + 4 * nr_handles)
> > + goto err_len;
> > + }
> > +
> > + return cc;
> You can return uninitialized cc here.
Thanks, good catch.
/Jarkko
Powered by blists - more mailing lists