aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
authorPetr Vandrovec <petr@vmware.com>2017-03-29 00:43:30 -0700
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2017-04-25 00:27:18 +0300
commitfd5c78694f3f1c875e293de7a641ba8a3d60d00d (patch)
treefcff3dc9a930e3e36f631d97d83a0c009332328b /security/security.c
parenttpm_crb: remove a cruft constant (diff)
downloadlinux-dev-fd5c78694f3f1c875e293de7a641ba8a3d60d00d.tar.xz
linux-dev-fd5c78694f3f1c875e293de7a641ba8a3d60d00d.zip
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: 4d23cc323cdb ("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>
Diffstat (limited to 'security/security.c')
0 files changed, 0 insertions, 0 deletions