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

2016-10-11 Thread Nayna
On 10/12/2016 01:45 AM, Jason Gunthorpe wrote: > On Wed, Oct 12, 2016 at 12:41:05AM +0530, Nayna wrote: > >> Yeah, I actually tried this today. >> And on call of securityfs_remove(), release() gets called for the >> opened > > Are you saying securityfs_remove somehow causes a synchronous call to

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

2016-10-11 Thread Jason Gunthorpe
On Wed, Oct 12, 2016 at 12:41:05AM +0530, Nayna wrote: > Yeah, I actually tried this today. > And on call of securityfs_remove(), release() gets called for the > opened Are you saying securityfs_remove somehow causes a synchronous call to release? How does that come about? > There are actually

Re: [tpmdd-devel] [PATCH 1/3] tpm_crb: map locality registers

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 11:01:43AM -0600, Jason Gunthorpe wrote: > On Tue, Oct 11, 2016 at 12:23:04PM +0300, Jarkko Sakkinen wrote: > > In order to provide access to locality registers, this commits adds > > mapping of the head of the CRB registers, which are located right > > before the control

Re: [tpmdd-devel] [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 10:49:56PM +0530, Nayna wrote: > > > On 10/11/2016 10:23 PM, Jason Gunthorpe wrote: > >On Tue, Oct 11, 2016 at 02:23:15PM +0300, Jarkko Sakkinen wrote: > + chip->bios_dir[cnt] = > securityfs_create_file("ascii_bios_measurements", > -

Re: [tpmdd-devel] [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 10:53:55AM -0600, Jason Gunthorpe wrote: > On Tue, Oct 11, 2016 at 02:23:15PM +0300, Jarkko Sakkinen wrote: > > > >+chip->bios_dir[cnt] = > > > > securityfs_create_file("ascii_bios_measurements", > > > >- S_IRUSR |

Re: [tpmdd-devel] [PATCH] char/tpm: Check return code of wait_for_tpm_stat

2016-10-11 Thread Peter Huewe
Hi Am 11. Oktober 2016 19:13:13 MESZ, schrieb Jason Gunthorpe : >On Tue, Oct 11, 2016 at 03:01:01PM +0300, Jarkko Sakkinen wrote: >> From: Peter Huewe >> >> In some weird cases it might be possible that the TPM does not set >> STS.VALID

Re: [tpmdd-devel] [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array

2016-10-11 Thread Nayna
On 10/11/2016 10:23 PM, Jason Gunthorpe wrote: > On Tue, Oct 11, 2016 at 02:23:15PM +0300, Jarkko Sakkinen wrote: + chip->bios_dir[cnt] = securityfs_create_file("ascii_bios_measurements", - S_IRUSR | S_IRGRP, tpm_dir, +

Re: [tpmdd-devel] [PATCH] char/tpm: Check return code of wait_for_tpm_stat

2016-10-11 Thread Jason Gunthorpe
On Tue, Oct 11, 2016 at 03:01:01PM +0300, Jarkko Sakkinen wrote: > From: Peter Huewe > > In some weird cases it might be possible that the TPM does not set > STS.VALID within the given timeout time (or ever) but sets STS.EXPECT > (STS=0x0C) In this case the driver gets stuck

Re: [tpmdd-devel] [PATCH 1/3] tpm_crb: map locality registers

2016-10-11 Thread Jason Gunthorpe
On Tue, Oct 11, 2016 at 12:23:04PM +0300, Jarkko Sakkinen wrote: > In order to provide access to locality registers, this commits adds > mapping of the head of the CRB registers, which are located right > before the control area. I think you should squash this into the prior patch, no sense in

Re: [tpmdd-devel] [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array

2016-10-11 Thread Jason Gunthorpe
On Tue, Oct 11, 2016 at 02:23:15PM +0300, Jarkko Sakkinen wrote: > > >+ chip->bios_dir[cnt] = > > > securityfs_create_file("ascii_bios_measurements", > > >- S_IRUSR | S_IRGRP, tpm_dir, > > >+ S_IRUSR | S_IRGRP, chip->bios_dir[0], > > >

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

2016-10-11 Thread Jason Gunthorpe
On Mon, Oct 10, 2016 at 09:43:05AM +0530, Nayna wrote: > > > On 10/10/2016 08:51 AM, Jason Gunthorpe wrote: > >On Mon, Oct 10, 2016 at 07:23:33AM +0530, Nayna wrote: > > > >>And we pass this as private data to i_node in tpm_bios_log_setup. > > > >>So, we are referring chip as

Re: [tpmdd-devel] Suspend/Resume issue in 4.8-rc8

2016-10-11 Thread Jarkko Sakkinen
On Mon, Oct 10, 2016 at 02:36:43AM -0400, Genki Marshall wrote: > Hello, > > On 4.8-rc8, I'm having an issue with laptop suspend/resume for the > Chromebook Pixel (2015). Specifically: > > When on commit 24532f7 on Linus's tree (latest commit at time of > writing) I'm having the following

Re: [tpmdd-devel] [PATCH 2/3] tpm_crb: encapsulate crb_wait_for_reg_32

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 10:21:03AM +, Winkler, Tomas wrote: > > Encapsulated crb_wait_for_reg32() so that state changes in other CRB > > registers > > than TPM_CRB_CTRL_REQ_x can be waited. > > > > Signed-off-by: Jarkko Sakkinen > > --- > >

Re: [tpmdd-devel] [PATCH 1/3] tpm_crb: map locality registers

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 12:23:04PM +0300, Jarkko Sakkinen wrote: > In order to provide access to locality registers, this commits adds > mapping of the head of the CRB registers, which are located right > before the control area. > > Signed-off-by: Jarkko Sakkinen

Re: [tpmdd-devel] [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array

2016-10-11 Thread Jarkko Sakkinen
On Tue, Oct 11, 2016 at 12:23:15AM +0530, Nayna wrote: > > > On 10/02/2016 12:55 AM, Jarkko Sakkinen wrote: > >This commit is based on a commit by Nayna Jain. Replaced dynamically > >allocated bios_dir with a static array as the size is always constant. > > > >Suggested-by: Jason Gunthorpe

Re: [tpmdd-devel] [PATCH 2/3] tpm_crb: encapsulate crb_wait_for_reg_32

2016-10-11 Thread Winkler, Tomas
> Encapsulated crb_wait_for_reg32() so that state changes in other CRB registers > than TPM_CRB_CTRL_REQ_x can be waited. > > Signed-off-by: Jarkko Sakkinen > --- > drivers/char/tpm/tpm_crb.c | 40 +++- > 1 file changed, 23

[tpmdd-devel] [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-11 Thread Jarkko Sakkinen
In order to allow to use locality 0, expand the data structure to expose all of the CRB registers. The address is calculated from the control area address in order to retain backwards compatibility to ACPI start based hardware (pre-Skylake). Signed-off-by: Jarkko Sakkinen

[tpmdd-devel] [PATCH 3/3] tpm_crb: request and relinquish locality 0

2016-10-11 Thread Jarkko Sakkinen
Request and relinquish locality for the driver use in order to be a better citizen in a multi locality environment like TXT. The locality is requested and relinquished as part of going into and waking up from idle. Signed-off-by: Jarkko Sakkinen ---

[tpmdd-devel] [PATCH 2/3] tpm_crb: encapsulate crb_wait_for_reg_32

2016-10-11 Thread Jarkko Sakkinen
Encapsulated crb_wait_for_reg32() so that state changes in other CRB registers than TPM_CRB_CTRL_REQ_x can be waited. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_crb.c | 40 +++- 1 file changed, 23 insertions(+),