linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>, jmorris@namei.org
Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org
Subject: Re: [PATCH v2] tpm: fix race condition in tpm_common_write()
Date: Wed, 30 May 2018 23:54:38 +0300	[thread overview]
Message-ID: <20180530205438.GA27912@linux.intel.com> (raw)
In-Reply-To: <20180530171315.GA23184@linux.intel.com>

James,

On Wed, May 30, 2018 at 08:13:15PM +0300, Jarkko Sakkinen wrote:
> On Wed, May 23, 2018 at 04:50:03PM +0300, Jarkko Sakkinen wrote:
> > On Tue, May 22, 2018 at 02:37:18PM -0700, Tadeusz Struk wrote:
> > > There is a race condition in tpm_common_write function allowing
> > > two threads on the same /dev/tpm<N>, or two different applications
> > > on the same /dev/tpmrm<N> to overwrite each other commands/responses.
> > > Fixed this by taking the priv->buffer_mutex early in the function.
> > > 
> > > Also converted the priv->data_pending from atomic to a regular size_t
> > > type. There is no need for it to be atomic since it is only touched
> > > under the protection of the priv->buffer_mutex.
> > > 
> > > v2: convert data_pending from atomic to a regular size_t type.
> > > 
> > > Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
> > > ---
> > 
> > The changel log should be here in diff stat (i.e. at this point) so that
> > the change log does not get pulled into the final commit message.
> > 
> > /Jarkko
> 
> I pushed it now with appropriate tags, please check.
> 
> /Jarkko

Should I make a follow up PR for 4.18 with only this fix included?

/Jarkko

  parent reply	other threads:[~2018-05-30 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 21:37 [PATCH v2] tpm: fix race condition in tpm_common_write() Tadeusz Struk
2018-05-23 13:50 ` Jarkko Sakkinen
2018-05-30 17:13   ` Jarkko Sakkinen
2018-05-30 17:24     ` Tadeusz Struk
2018-05-30 20:54     ` Jarkko Sakkinen [this message]
2018-05-30 23:55       ` James Morris
2018-06-02 12:32         ` 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=20180530205438.GA27912@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=tadeusz.struk@intel.com \
    /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).