linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Alex Guzman <alex@guzman.io>
Cc: Mario Limonciello <Mario.Limonciello@dell.com>,
	Peter Huewe <peterhuewe@gmx.de>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
Subject: Re: [PATCH] tpm: Revert "tpm: fix invalid locking in NONBLOCKING mode"
Date: Tue, 26 May 2020 17:18:22 -0700	[thread overview]
Message-ID: <1590538702.3576.2.camel@HansenPartnership.com> (raw)
In-Reply-To: <CAJ7-PMaoFyi89OFgYsNknc2d0Fr4RHLmmHo-puNiKchM=0mU6w@mail.gmail.com>

On Tue, 2020-05-26 at 16:31 -0700, Alex Guzman wrote:
> On Tue, May 26, 2020 at 4:06 PM James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > 
> > On Tue, 2020-05-26 at 15:19 -0700, Alex Guzman wrote:
> > [...]
> > > When using your patch, I get a hang when trying to use
> > > tpm2_getcap, and dmesg shows some info.
> > 
> > Are you sure it's all applied?  This
> > 
> > > [  570.913803]  tpm_tcg_write_bytes+0x2f/0x40
> > > [  570.913805]  release_locality+0x49/0x220
> > > [  570.913807]  tpm_relinquish_locality+0x1f/0x40
> > > [  570.913808]  tpm_chip_stop+0x21/0x40
> > > [  570.913810]  tpm_put_ops+0x9/0x30
> > > [  570.913811]  tpm_common_write+0x179/0x190
> > > [  570.913813]  vfs_write+0xb1/0x1a0
> > 
> > Implies an unmatched tpm_put_ops() in the async write path, as
> > though this hunk:
> > 
> > > @@ -211,11 +202,19 @@ ssize_t tpm_common_write(struct file *file,
> > > const char __user *buf,
> > >         if (file->f_flags & O_NONBLOCK) {
> > >                 priv->command_enqueued = true;
> > >                 queue_work(tpm_dev_wq, &priv->async_work);
> > > -               tpm_put_ops(priv->chip);
> > >                 mutex_unlock(&priv->buffer_mutex);
> > >                 return size;
> > >         }
> > 
> > Is missing.  I actually booted the patch in my TPM based VM and it
> > all seems to work OK when I execute tpm2_getcap (I verified it's
> > using O_NONBLOCK) and tssgetcapability in sync mode.
> > 
> > James
> > 
> 
> Oh, I did miss that bit. The patch had issues applying for some
> reason and I missed the single-line removal when I was looking at the
> diff.

Sorry, that's likely my fault: I did it on top of my current TPM tree.
I'll prepare a version against the vanilla kernel with a real
changelog.

> I gave it a spin on my machine again. getcap seems to work correctly
> with and without having the async config flag set for tpm2-tss. The
> pkcs11 plugin seems to work correctly again too. :)

Great, thanks!  I'll add your tested-by to the above.

James


  reply	other threads:[~2020-05-27  0:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 18:32 [PATCH] tpm: Revert "tpm: fix invalid locking in NONBLOCKING mode" Mario Limonciello
2020-05-26 19:14 ` James Bottomley
2020-05-26 19:23   ` Mario.Limonciello
2020-05-26 19:38     ` James Bottomley
2020-05-26 22:19       ` Alex Guzman
2020-05-26 23:06         ` James Bottomley
2020-05-26 23:31           ` Alex Guzman
2020-05-27  0:18             ` James Bottomley [this message]
2020-05-27 20:09       ` Jarkko Sakkinen
2020-05-27 20:18         ` Mario.Limonciello
2020-05-28  0:43           ` Jarkko Sakkinen
2020-05-28  0:59             ` Mario.Limonciello
2020-05-28  6:53               ` Jarkko Sakkinen
2020-05-27 20:15     ` Jarkko Sakkinen
2020-05-28  1:10       ` Alex Guzman
2020-05-28  6:54         ` Jarkko Sakkinen
2020-05-28 22:33         ` James Bottomley
2020-05-26 19:39   ` Tadeusz Struk
2020-05-26 20:00     ` James Bottomley
2020-05-26 21:33       ` Tadeusz Struk
2020-05-26 22:34         ` Alex Guzman
2020-05-28  0:30     ` Jarkko Sakkinen
2020-05-28  4:40       ` Tadeusz Struk
2020-05-28  6:55         ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1590538702.3576.2.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=alex@guzman.io \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jeffrin@rajagiritech.edu.in \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).