linux-bl808/drivers/char/tpm
Petr Vandrovec fd5c78694f tpm: fix handling of the TPM 2.0 event logs
When TPM2 log has entries with more than 3 digests, or with digests
not listed in the log header, log gets misparsed, eventually
leading to kernel complaint that code tried to vmalloc 512MB of
memory (I have no idea what would happen on bigger system).

So code should not parse only first 3 digests: both event header
and event itself are already in memory, so we can parse any number
of digests, as long as we do not try to parse whole memory when
given count of 0xFFFFFFFF.

So this change:

* Rejects event entry with more digests than log header describes.
  Digest types should be unique, and all should be described in
  log header, so there cannot be more digests in the event than in
  the header.

* Reject event entry with digest that is not described in the
  log header.  In theory code could hardcode information about
  digest IDs already assigned by TCG, but if firmware authors
  cannot get event log format right, why should anyone believe
  that they got event log content right.

Cc: stable@vger.kernel.org
Fixes: 4d23cc323c ("tpm: add securityfs support for TPM 2.0 firmware event log")
Signed-off-by: Petr Vandrovec <petr@vmware.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2017-04-25 00:27:18 +03:00
..
st33zp24 tpm: make check_locality return bool 2017-04-03 22:46:02 +03:00
Kconfig tpm/tpm_crb: Enable TPM CRB interface for ARM64 2017-04-03 22:46:03 +03:00
Makefile tpm: expose spaces via a device link /dev/tpmrm<n> 2017-04-03 22:46:02 +03:00
tpm-chip.c tpm_crb: request and relinquish locality 0 2017-04-03 22:46:02 +03:00
tpm-dev-common.c tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c 2017-04-03 22:46:01 +03:00
tpm-dev.c tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c 2017-04-03 22:46:01 +03:00
tpm-dev.h tpm: split out tpm-dev.c into tpm-dev.c and tpm-common-dev.c 2017-04-03 22:46:01 +03:00
tpm-interface.c tpm_crb: request and relinquish locality 0 2017-04-03 22:46:02 +03:00
tpm-sysfs.c tpm: infrastructure for TPM spaces 2017-04-03 22:46:01 +03:00
tpm.h tpm_crb: request and relinquish locality 0 2017-04-03 22:46:02 +03:00
tpm1_eventlog.c
tpm2-cmd.c tpm: infrastructure for TPM spaces 2017-04-03 22:46:01 +03:00
tpm2-space.c tpm2: add session handle context saving and restoring to the space code 2017-04-03 22:46:02 +03:00
tpm2_eventlog.c tpm: fix handling of the TPM 2.0 event logs 2017-04-25 00:27:18 +03:00
tpm_acpi.c
tpm_atmel.c
tpm_atmel.h
tpm_crb.c tpm_crb: remove a cruft constant 2017-04-25 00:27:18 +03:00
tpm_eventlog.h
tpm_i2c_atmel.c
tpm_i2c_infineon.c tpm: make check_locality return bool 2017-04-03 22:46:02 +03:00
tpm_i2c_nuvoton.c tpm: add sleep only for retry in i2c_nuvoton_write_status() 2017-04-03 22:46:02 +03:00
tpm_ibmvtpm.c vTPM: Fix missing NULL check 2017-04-03 22:46:02 +03:00
tpm_ibmvtpm.h
tpm_infineon.c
tpm_nsc.c
tpm_of.c
tpm_ppi.c
tpm_tis.c
tpm_tis_core.c tpm: make check_locality return bool 2017-04-03 22:46:02 +03:00
tpm_tis_core.h
tpm_tis_spi.c tpm_tis_spi: Add small delay after last transfer 2017-04-03 22:46:01 +03:00
tpm_vtpm_proxy.c
tpmrm-dev.c tpm2: add session handle context saving and restoring to the space code 2017-04-03 22:46:02 +03:00
xen-tpmfront.c tpm xen: drop unneeded chip variable 2017-02-14 19:24:33 +02:00