Tadeusz Struk 18c3955323 tpm: Handle negative priv->response_len in tpm_common_read()
commit a430e67d9a2c62a8c7b315b99e74de02018d0a96 upstream.

The priv->response_length can hold the size of an response or an negative
error code, and the tpm_common_read() needs to handle both cases correctly.
Changed the type of response_length to signed and accounted for negative
value in tpm_common_read().

Cc: stable@vger.kernel.org
Fixes: d23d12484307 ("tpm: fix invalid locking in NONBLOCKING mode")
Reported-by: Laura Abbott <labbott@redhat.com>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 20:08:21 +01:00
..
2019-08-16 14:32:26 -07:00
2018-06-05 11:24:55 -07:00
2019-06-09 09:11:21 +02:00
2019-12-13 08:42:17 +01:00
2019-08-16 11:33:56 -07:00
2019-12-17 19:56:41 +01:00