Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-11 Thread Nayna
Hi Jarkko, On 07/09/2019 12:38 PM, Jarkko Sakkinen wrote: On Mon, Jul 08, 2019 at 03:43:04PM -0700, Christoph Hellwig wrote: On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: static int tpm_get_pcr_allocation(struct tpm_chip *chip) { int rc; rc = (chip->flags & TPM_

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-09 Thread Jarkko Sakkinen
On Mon, Jul 08, 2019 at 03:43:04PM -0700, Christoph Hellwig wrote: > On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: > > > static int tpm_get_pcr_allocation(struct tpm_chip *chip) > > > { > > > int rc; > > > > > > rc = (chip->flags & TPM_CHIP_FLAG_TPM2) ? > > >tpm2_

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-09 Thread Jarkko Sakkinen
On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: > > static int tpm_get_pcr_allocation(struct tpm_chip *chip) > > { > > int rc; > > > > rc = (chip->flags & TPM_CHIP_FLAG_TPM2) ? > > tpm2_get_pcr_allocation(chip) : > > tpm1_get_pcr_allocation(chi

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-08 Thread Jason Gunthorpe
On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: > Hi Jarkko, > > On Mon, 2019-07-08 at 18:11 +0300, Jarkko Sakkinen wrote: > > On Sat, 2019-07-06 at 20:18 -0400, Nayna Jain wrote: > > > +/* > > > + * tpm_get_pcr_allocation() - initialize the chip allocated banks for > > > PCRs > > > +

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-08 Thread Christoph Hellwig
On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote: > > static int tpm_get_pcr_allocation(struct tpm_chip *chip) > > { > > int rc; > > > > rc = (chip->flags & TPM_CHIP_FLAG_TPM2) ? > > tpm2_get_pcr_allocation(chip) : > > tpm1_get_pcr_allocation(chi

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-08 Thread Mimi Zohar
Hi Jarkko, On Mon, 2019-07-08 at 18:11 +0300, Jarkko Sakkinen wrote: > On Sat, 2019-07-06 at 20:18 -0400, Nayna Jain wrote: > > +/* > > + * tpm_get_pcr_allocation() - initialize the chip allocated banks for PCRs > > + * @chip: TPM chip to use. > > + */ > > +static int tpm_get_pcr_allocation(struct

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-08 Thread Jarkko Sakkinen
On Sat, 2019-07-06 at 20:18 -0400, Nayna Jain wrote: > +/* > + * tpm_get_pcr_allocation() - initialize the chip allocated banks for PCRs > + * @chip: TPM chip to use. > + */ > +static int tpm_get_pcr_allocation(struct tpm_chip *chip) > +{ > + int rc; > + > + if (chip->flags & TPM_CHIP_FLAG_

Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-07 Thread Stefan Berger
On 7/6/19 8:18 PM, Nayna Jain wrote: The nr_allocated_banks and allocated banks are initialized as part of tpm_chip_register. Currently, this is done as part of auto startup function. However, some drivers, like the ibm vtpm driver, do not run auto startup during initialization. This results in u

[PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks

2019-07-06 Thread Nayna Jain
The nr_allocated_banks and allocated banks are initialized as part of tpm_chip_register. Currently, this is done as part of auto startup function. However, some drivers, like the ibm vtpm driver, do not run auto startup during initialization. This results in uninitialized memory issue and causes a