Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-07 Thread Jarkko Sakkinen
On Mon, Nov 07, 2016 at 05:29:43PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 07, 2016 at 04:26:43PM -0800, Jarkko Sakkinen wrote: > > On Mon, Nov 07, 2016 at 04:48:39PM -0700, Jason Gunthorpe wrote: > > > On Thu, Nov 03, 2016 at 11:14:10PM -0600, Jarkko Sakkinen wrote: > > > > On Tue, Oct 18,

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-07 Thread Jarkko Sakkinen
On Mon, Nov 07, 2016 at 04:26:42PM -0800, Jarkko Sakkinen wrote: > On Mon, Nov 07, 2016 at 04:48:39PM -0700, Jason Gunthorpe wrote: > > On Thu, Nov 03, 2016 at 11:14:10PM -0600, Jarkko Sakkinen wrote: > > > On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > > > > Currently, the event

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-07 Thread Jason Gunthorpe
On Mon, Nov 07, 2016 at 04:26:43PM -0800, Jarkko Sakkinen wrote: > On Mon, Nov 07, 2016 at 04:48:39PM -0700, Jason Gunthorpe wrote: > > On Thu, Nov 03, 2016 at 11:14:10PM -0600, Jarkko Sakkinen wrote: > > > On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > > > > Currently, the event

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-07 Thread Jarkko Sakkinen
On Mon, Nov 07, 2016 at 04:48:39PM -0700, Jason Gunthorpe wrote: > On Thu, Nov 03, 2016 at 11:14:10PM -0600, Jarkko Sakkinen wrote: > > On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > > > Currently, the event log file operations are not serialized with > > > tpm_chip_unregister(),

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-07 Thread Jason Gunthorpe
On Thu, Nov 03, 2016 at 11:14:10PM -0600, Jarkko Sakkinen wrote: > On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > > Currently, the event log file operations are not serialized with > > tpm_chip_unregister(), which can possibly cause a race condition. > > > > This patch fixes the

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-11-03 Thread Jarkko Sakkinen
On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > Currently, the event log file operations are not serialized with > tpm_chip_unregister(), which can possibly cause a race condition. > > This patch fixes the race condition by: > - moving read_log() from fops to chip register. What

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-10-20 Thread Jason Gunthorpe
On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > + struct tpm_chip_seqops *chip_seqops; > + const struct seq_operations *seqops; > + struct tpm_chip *chip; > + > + inode_lock(inode); > + if (!inode->i_private) { > + inode_unlock(inode); > +

Re: [tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-10-19 Thread Jarkko Sakkinen
On Tue, Oct 18, 2016 at 08:49:42PM -0400, Nayna Jain wrote: > Currently, the event log file operations are not serialized with > tpm_chip_unregister(), which can possibly cause a race condition. > > This patch fixes the race condition by: > - moving read_log() from fops to chip register. > -

[tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-10-18 Thread Nayna Jain
Currently, the event log file operations are not serialized with tpm_chip_unregister(), which can possibly cause a race condition. This patch fixes the race condition by: - moving read_log() from fops to chip register. - disallowing event log file operations when chip unregister is in