All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: tadeusz.struk@intel.com, jarkko.sakkinen@linux.intel.com,
	stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] tpm: fix race condition in tpm_common_write()" failed to apply to 4.4-stable tree
Date: Sun, 12 Aug 2018 17:26:22 +0200	[thread overview]
Message-ID: <20180812152622.GC30273@kroah.com> (raw)
In-Reply-To: <20180812134834.etnovqh5co2qef7m@debian>

On Sun, Aug 12, 2018 at 02:48:34PM +0100, Sudip Mukherjee wrote:
> Hi Greg,
> 
> On Sun, Jul 01, 2018 at 11:34:24AM +0200, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.4-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> 
> The attached backported patch should apply to 4.4-stable tree. It will
> also apply to 4.9-stable.
> 
> It did not apply originally as patch was looking for the splitted files.
> The split was done by:
> ecb38e2f521b ("tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c")
> 
> --
> Regards
> Sudip

> >From a8298614c8686b8c9e8706d79a63634cde4684e4 Mon Sep 17 00:00:00 2001
> From: Tadeusz Struk <tadeusz.struk@intel.com>
> Date: Tue, 22 May 2018 14:37:18 -0700
> Subject: [PATCH] tpm: fix race condition in tpm_common_write()
> 
> 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>
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
>  drivers/char/tpm/tpm-dev.c | 41 +++++++++++++++++++----------------------
>  1 file changed, 19 insertions(+), 22 deletions(-)

Sorry, but someone already backported this before you did.

thanks,

greg k-h

      reply	other threads:[~2018-08-12 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01  9:34 FAILED: patch "[PATCH] tpm: fix race condition in tpm_common_write()" failed to apply to 4.4-stable tree gregkh
2018-08-12 13:48 ` Sudip Mukherjee
2018-08-12 15:26   ` Greg KH [this message]

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=20180812152622.GC30273@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --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.