summaryrefslogtreecommitdiff
path: root/include/linux/tpm_eventlog.h
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2019-10-02 19:59:01 +0300
committerIngo Molnar <mingo@kernel.org>2019-10-07 16:24:35 +0300
commit05c8c1ff81ed2eb9bad7c27cf92e55c864c16df8 (patch)
tree960941ee830c1575820e3e1488194ceb67e56eae /include/linux/tpm_eventlog.h
parent047d50aee341d940350897c85799e56ae57c3849 (diff)
downloadlinux-05c8c1ff81ed2eb9bad7c27cf92e55c864c16df8.tar.xz
efi/tpm: Don't traverse an event log with no events
When there are no entries to put into the final event log, some machines will return the template they would have populated anyway. In this case the nr_events field is 0, but the rest of the log is just garbage. This patch stops us from trying to iterate the table with __calc_tpm2_event_size() when the number of events in the table is 0. Tested-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Acked-by: Matthew Garrett <mjg59@google.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ben Dooks <ben.dooks@codethink.co.uk> Cc: Dave Young <dyoung@redhat.com> Cc: Jerry Snitselaar <jsnitsel@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Lukas Wunner <lukas@wunner.de> Cc: Octavian Purdila <octavian.purdila@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Scott Talbert <swt@techie.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Cc: linux-integrity@vger.kernel.org Cc: stable@vger.kernel.org Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") Link: https://lkml.kernel.org/r/20191002165904.8819-5-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/tpm_eventlog.h')
0 files changed, 0 insertions, 0 deletions