On Mon, Jan 09, 2017 at 11:46:58PM +0200, Jarkko Sakkinen wrote: > From: Josh Zimmerman <jo...@google.com> > > If the TPM we're connecting to uses a static burst count, it will report > a burst count of zero throughout the response read. However, get_burstcount > assumes that a response of zero indicates that the TPM is not ready to > receive more data. In this case, it returns a negative error code, which > is passed on to tpm_tis_{write,read}_bytes as a u16, causing > them to read/write far too many bytes. > > This patch checks for negative return codes and bails out from recv_data > and tpm_tis_send_data. > > Cc: sta...@vger.kernel.org > Fixes: 1107d065fdf1 (tpm_tis: Introduce intermediate layer for TPM access) > Signed-off-by: Josh Zimmerman <jo...@google.com> > Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> > Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> > --- > Backport for 4.8 and 4.9
4.8 is now end-of-life, but I've queued this up for 4.9-stable, many thanks! greg k-h