android_kernel_oneplus_msm8998/drivers/char/tpm
Jeremy Boone 34e924e599 tpm_tis: fix potential buffer overruns caused by bit glitches on the bus
commit 6bb320ca4a4a7b5b3db8c8d7250cc40002046878 upstream.

Discrete TPMs are often connected over slow serial buses which, on
some platforms, can have glitches causing bit flips.  In all the
driver _recv() functions, we need to use a u32 to unmarshal the
response size, otherwise a bit flip of the 31st bit would cause the
expected variable to go negative, which would then try to read a huge
amount of data.  Also sanity check that the expected amount of data is
large enough for the TPM header.

Signed-off-by: Jeremy Boone <jeremy.boone@nccgroup.trust>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-24 10:58:39 +01:00
..
st33zp24 tpm: st33zp24: fix potential buffer overruns caused by bit glitches on the bus 2018-03-11 16:19:44 +01:00
Kconfig tpm: Update KConfig text to include TPM2.0 FIFO chips 2015-03-18 22:43:07 +01:00
Makefile tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy) 2015-03-18 22:43:06 +01:00
tpm-chip.c tpm: Replace device number bitmap with IDR 2017-08-06 19:19:43 -07:00
tpm-dev.c tpm: Provide strong locking for device removal 2017-07-21 07:44:58 +02:00
tpm-interface.c tpm: fix potential buffer overruns caused by bit glitches on the bus 2018-03-24 10:58:39 +01:00
tpm-sysfs.c tpm: fix a kernel memory leak in tpm-sysfs.c 2017-08-06 19:19:43 -07:00
tpm.h tpm: Replace device number bitmap with IDR 2017-08-06 19:19:43 -07:00
tpm2-cmd.c tpm: fix potential buffer overruns caused by bit glitches on the bus 2018-03-24 10:58:39 +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: Get rid of chip->pdev 2017-07-21 07:44:58 +02:00
tpm_atmel.h
tpm_crb.c tpm_crb: check for bad response size 2017-05-25 14:30:07 +02:00
tpm_eventlog.c tpm_eventlog.c: fix binary_bios_measurements 2016-04-12 09:08:47 -07:00
tpm_eventlog.h vTPM: support little endian guests 2015-10-19 01:09:30 +02:00
tpm_i2c_atmel.c tpm: Get rid of chip->pdev 2017-07-21 07:44:58 +02:00
tpm_i2c_infineon.c tpm_i2c_infineon: fix potential buffer overruns caused by bit glitches on the bus 2018-03-11 16:19:44 +01:00
tpm_i2c_nuvoton.c tpm_i2c_nuvoton: fix potential buffer overruns caused by bit glitches on the bus 2018-03-11 16:19:44 +01:00
tpm_ibmvtpm.c vTPM: fix memory allocation flag for rtce buffer at kernel boot 2015-10-19 01:00:49 +02:00
tpm_ibmvtpm.h tpm/ibmvtpm: Additional LE support for tpm_ibmvtpm_send 2015-03-06 22:35:48 +01:00
tpm_infineon.c tpm: Get rid of chip->pdev 2017-07-21 07:44:58 +02:00
tpm_nsc.c tpm: Get rid of chip->pdev 2017-07-21 07:44:58 +02:00
tpm_of.c TPM: Avoid reference to potentially freed memory 2015-11-09 17:52:55 +02:00
tpm_ppi.c tpm: move the PPI attributes to character device directory. 2015-10-19 01:01:20 +02:00
tpm_tis.c tpm_tis: fix potential buffer overruns caused by bit glitches on the bus 2018-03-24 10:58:39 +01:00
xen-tpmfront.c tpm xen: Remove bogus tpm_chip_unregister 2017-01-06 11:16:16 +01:00