From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: stable@vger.kernel.org, tadeusz.struk@intel.com
Subject: Re: [PATCH] tpm: fix race condition in tpm_common_write()
Date: Fri, 10 Aug 2018 19:44:02 +0300 [thread overview]
Message-ID: <20180810164401.GO4692@linux.intel.com> (raw)
In-Reply-To: <20180810141058.GB6950@kroah.com>
On Fri, Aug 10, 2018 at 04:10:58PM +0200, Greg KH wrote:
> On Wed, Aug 08, 2018 at 03:35:50PM +0300, Jarkko Sakkinen wrote:
> > From: Tadeusz Struk <tadeusz.struk@intel.com>
> >
> > commit 3ab2011ea368ec3433ad49e1b9e1c7b70d2e65df upstream
> >
> > 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.
> >
> > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
> > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > ---
> > Manually backported for v4.4 and v4.9.
>
> Now queued up, thanks.
Great, thank you.
> greg k-h
/Jarkko
next prev parent reply other threads:[~2018-08-10 19:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 12:35 [PATCH] tpm: fix race condition in tpm_common_write() Jarkko Sakkinen
2018-08-10 14:10 ` Greg KH
2018-08-10 16:44 ` Jarkko Sakkinen [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-22 17:32 Tadeusz Struk
2018-05-22 20:07 ` Jason Gunthorpe
2018-05-22 20:26 ` Tadeusz Struk
2018-05-23 13:23 ` Jarkko Sakkinen
2018-05-23 13:23 ` Jarkko Sakkinen
2018-05-23 17:57 ` Tadeusz Struk
2018-05-23 17:57 ` Tadeusz Struk
2018-05-23 19:41 ` Jason Gunthorpe
2018-05-23 19:41 ` Jason Gunthorpe
2018-05-30 11:01 ` Jarkko Sakkinen
2018-05-30 11:01 ` Jarkko Sakkinen
2018-05-30 11:01 ` Jarkko Sakkinen
2018-05-30 11:01 ` 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=20180810164401.GO4692@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=greg@kroah.com \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.