Re: [PATCH v2] tpm: fix race condition in tpm_common_write()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> > ---
> 
> 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux