Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-22 Thread Jason Gunthorpe
On Fri, Jun 22, 2018 at 07:40:37AM -0400, Stefan Berger wrote: > On 06/21/2018 11:25 PM, Jason Gunthorpe wrote: > >On Thu, Jun 21, 2018 at 04:59:55PM -0400, Stefan Berger wrote: > >>On 06/21/2018 04:53 PM, Mimi Zohar wrote: > >>>On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: > Rather t

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-22 Thread Stefan Berger
On 06/21/2018 11:25 PM, Jason Gunthorpe wrote: On Thu, Jun 21, 2018 at 04:59:55PM -0400, Stefan Berger wrote: On 06/21/2018 04:53 PM, Mimi Zohar wrote: On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: Rather than accessing the TPM functions using a NULL pointer, which causes a lookup fo

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-21 Thread Jason Gunthorpe
On Thu, Jun 21, 2018 at 04:59:55PM -0400, Stefan Berger wrote: > On 06/21/2018 04:53 PM, Mimi Zohar wrote: > >On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: > >>Rather than accessing the TPM functions using a NULL pointer, which > >>causes a lookup for a suitable chip every time, get a hol

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-21 Thread Stefan Berger
On 06/21/2018 04:53 PM, Mimi Zohar wrote: On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: Rather than accessing the TPM functions using a NULL pointer, which causes a lookup for a suitable chip every time, get a hold of a tpm_chip and access the TPM functions using this chip. We call the

Re: [PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-21 Thread Mimi Zohar
On Wed, 2018-06-20 at 16:42 -0400, Stefan Berger wrote: > Rather than accessing the TPM functions using a NULL pointer, which > causes a lookup for a suitable chip every time, get a hold of a tpm_chip > and access the TPM functions using this chip. We call the tpm_chip > ima_tpm_chip and protect it

[PATCH v2 3/4] ima: Use tpm_chip_find() and access TPM functions using it

2018-06-20 Thread Stefan Berger
Rather than accessing the TPM functions using a NULL pointer, which causes a lookup for a suitable chip every time, get a hold of a tpm_chip and access the TPM functions using this chip. We call the tpm_chip ima_tpm_chip and protect it, once initialization is done, using a rw_semaphore called ima_t