linux/drivers/char/tpm
Jia Zhang 75d0967d61 tpm: Fix off-by-one when reading binary_bios_measurements
commit 64494d39ff upstream.

It is unable to read the entry when it is the only one in
binary_bios_measurements:

00000000  00 00 00 00 08 00 00 00  c4 2f ed ad 26 82 00 cb
00000010  1d 15 f9 78 41 c3 44 e7  9d ae 33 20 00 00 00 00
00000020

This is obviously a firmware problem on my linux machine:

	Manufacturer: Inspur
	Product Name: SA5212M4
	Version: 01

However, binary_bios_measurements should return it any way,
rather than nothing, after all its content is completely
valid.

Fixes: 55a82ab318 ("tpm: add bios measurement log")
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
Reviewd-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
[bwh: Backported to 3.16:
 - Fix an additional comparison in tpm1_bios_measurements_start()
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-07-09 22:04:00 +01:00
..
Kconfig Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP 2014-04-07 16:36:11 -07:00
Makefile tpm: Move sysfs functions from tpm-interface to tpm-sysfs 2014-01-06 14:37:24 +01:00
tpm-dev.c tpm: fix race condition in tpm_common_write() 2018-11-20 18:05:05 +00:00
tpm-interface.c tpm: fix potential buffer overruns caused by bit glitches on the bus 2018-06-16 22:22:27 +01:00
tpm-sysfs.c tpm: fix a kernel memory leak in tpm-sysfs.c 2017-10-12 15:28:02 +01:00
tpm.h tpm: Make tpm-dev allocate a per-file structure 2014-01-06 14:37:25 +01:00
tpm_acpi.c ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. 2014-05-27 18:13:08 +02:00
tpm_atmel.c tpm: Create a tpm_class_ops structure and use it in the drivers 2014-01-06 14:37:25 +01:00
tpm_atmel.h tpmdd maintainers 2007-08-22 19:52:44 -07:00
tpm_eventlog.c tpm: Fix off-by-one when reading binary_bios_measurements 2019-07-09 22:04:00 +01:00
tpm_eventlog.h drivers/char/tpm: Add securityfs support for event log 2012-08-22 16:22:47 -05:00
tpm_i2c_atmel.c tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete 2019-07-09 22:04:00 +01:00
tpm_i2c_infineon.c tpm_i2c_infineon: fix potential buffer overruns caused by bit glitches on the bus 2018-06-16 22:22:27 +01:00
tpm_i2c_nuvoton.c tpm_i2c_nuvoton: fix potential buffer overruns caused by bit glitches on the bus 2018-06-16 22:22:27 +01:00
tpm_i2c_stm_st33.c tpm/tpm_i2c_stm_st33: Add status check when reading data on the FIFO 2015-02-24 10:01:05 +00:00
tpm_i2c_stm_st33.h tpm_i2c_stm_st33: fix oops when i2c client is unavailable 2013-02-05 09:38:24 -06:00
tpm_ibmvtpm.c vTPM: fix memory allocation flag for rtce buffer at kernel boot 2015-12-13 17:48:49 +00:00
tpm_ibmvtpm.h tpm/ibmvtpm: Additional LE support for tpm_ibmvtpm_send 2015-03-23 15:16:34 +00:00
tpm_infineon.c tpm: Create a tpm_class_ops structure and use it in the drivers 2014-01-06 14:37:25 +01:00
tpm_nsc.c tpm: Create a tpm_class_ops structure and use it in the drivers 2014-01-06 14:37:25 +01:00
tpm_of.c TPM: Avoid reference to potentially freed memory 2015-12-13 17:49:45 +00:00
tpm_ppi.c ACPI / TPM: Fix resume regression on Chromebooks 2014-05-12 01:13:28 +02:00
tpm_tis.c tpm_tis: fix potential buffer overruns caused by bit glitches on the bus 2018-06-16 22:22:27 +01:00
xen-tpmfront.c Features: 2014-01-22 22:00:18 -08:00