From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org
Subject: Re: [PATCH v2] tpm: fix race condition in tpm_common_write()
Date: Wed, 23 May 2018 16:50:03 +0300 [thread overview]
Message-ID: <20180523135003.GG363@linux.intel.com> (raw)
In-Reply-To: <152702503883.25871.17829919385428251068.stgit@tstruk-mobl1.jf.intel.com>
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
next prev parent reply other threads:[~2018-05-23 13:50 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 [this message]
2018-05-30 17:13 ` Jarkko Sakkinen
2018-05-30 17:24 ` Tadeusz Struk
2018-05-30 20:54 ` Jarkko Sakkinen
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=20180523135003.GG363@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=jgg@ziepe.ca \
--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 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.