Re: [tpmdd-devel] [PATCH v4 3/8] tpm: validate event log access before tpm_bios_log_setup

2016-09-30 Thread Jason Gunthorpe
On Fri, Sep 30, 2016 at 10:45:38PM +0300, Jarkko Sakkinen wrote: > Ok, this is interesting. What kind of refcounting bugs are related > to existing approach? IIRC it was because the log was being processed in an fops open() callback, which itself was not properly serialized against chip

Re: [tpmdd-devel] [PATCH v4 2/8] tpm: replace dynamically allocated bios_dir with dentry array

2016-09-30 Thread Jason Gunthorpe
On Fri, Sep 30, 2016 at 10:48:25PM +0300, Jarkko Sakkinen wrote: > On Fri, Sep 30, 2016 at 12:30:26PM -0600, Jason Gunthorpe wrote: > > On Fri, Sep 30, 2016 at 09:27:03PM +0300, Jarkko Sakkinen wrote: > > > On Wed, Sep 28, 2016 at 04:34:36AM -0400, Nayna Jain wrote: > > > > > > - struct

Re: [tpmdd-devel] [PATCH v4 2/8] tpm: replace dynamically allocated bios_dir with dentry array

2016-09-30 Thread Jarkko Sakkinen
On Fri, Sep 30, 2016 at 12:30:26PM -0600, Jason Gunthorpe wrote: > On Fri, Sep 30, 2016 at 09:27:03PM +0300, Jarkko Sakkinen wrote: > > On Wed, Sep 28, 2016 at 04:34:36AM -0400, Nayna Jain wrote: > > > > - struct dentry **bios_dir; > > > + struct dentry *bios_dir[3]; > > > + unsigned int

Re: [tpmdd-devel] [PATCH v4 3/8] tpm: validate event log access before tpm_bios_log_setup

2016-09-30 Thread Jarkko Sakkinen
On Fri, Sep 30, 2016 at 01:11:12PM -0600, Jason Gunthorpe wrote: > On Fri, Sep 30, 2016 at 09:57:43PM +0300, Jarkko Sakkinen wrote: > > On Wed, Sep 28, 2016 at 04:34:37AM -0400, Nayna Jain wrote: > > > Currently, the securityfs pseudo files for obtaining the firmware > > > event log are created

Re: [tpmdd-devel] [PATCH v4 8/8] tpm: add securityfs support for TPM 2.0 firmware event log

2016-09-30 Thread Jarkko Sakkinen
On Wed, Sep 28, 2016 at 04:34:42AM -0400, Nayna Jain wrote: > Unlike the device driver support for TPM 1.2, the TPM 2.0 support > does not create the securityfs pseudo files for displaying the > firmware event log. > > This patch enables support for providing the TPM 2.0 event log in > binary

Re: [tpmdd-devel] [PATCH v4 5/8] tpm: replace of_find_node_by_name() with dev of_node property

2016-09-30 Thread Jarkko Sakkinen
On Wed, Sep 28, 2016 at 04:34:39AM -0400, Nayna Jain wrote: > Using the device of_node property is a better way to refer to the > device tree node rather than of_find_node_by_name(). > > Suggested-by: Jason Gunthorpe > Signed-off-by: Nayna Jain

Re: [tpmdd-devel] [PATCH v4 3/8] tpm: validate event log access before tpm_bios_log_setup

2016-09-30 Thread Jason Gunthorpe
On Fri, Sep 30, 2016 at 09:57:43PM +0300, Jarkko Sakkinen wrote: > On Wed, Sep 28, 2016 at 04:34:37AM -0400, Nayna Jain wrote: > > Currently, the securityfs pseudo files for obtaining the firmware > > event log are created whether the event log properties exist or not. > > This patch creates ascii

Re: [tpmdd-devel] [PATCH v4 4/8] tpm: redefine read_log() to handle ACPI/OF at runtime

2016-09-30 Thread Jarkko Sakkinen
On Wed, Sep 28, 2016 at 04:34:38AM -0400, Nayna Jain wrote: > Currently, read_log() has two implementations: one for ACPI platforms > and the other for OF platforms. The proper one is selected at compile > time using Kconfig and #ifdef in the Makefile, which is not the > recommended approach. > >

Re: [tpmdd-devel] [PATCH v4 3/8] tpm: validate event log access before tpm_bios_log_setup

2016-09-30 Thread Jarkko Sakkinen
On Wed, Sep 28, 2016 at 04:34:37AM -0400, Nayna Jain wrote: > Currently, the securityfs pseudo files for obtaining the firmware > event log are created whether the event log properties exist or not. > This patch creates ascii and bios measurements pseudo files > only if read_log() is successful. >

Re: [tpmdd-devel] [PATCH v4 2/8] tpm: replace dynamically allocated bios_dir with dentry array

2016-09-30 Thread Jarkko Sakkinen
On Wed, Sep 28, 2016 at 04:34:36AM -0400, Nayna Jain wrote: > bios_dir is defined as struct dentry **bios_dir, which results in > dynamic allocation and therefore possibly a memory leak. This patch > replaces it with struct dentry array(struct dentry *bios_dir[3]) > similar to what is done for