Re: [PATCH] tpm: eventlog: check the payload size before reading tag events

From: Guanglei Zhu

Date: Tue Nov 03 2026 - 21:58:27 EST


The legacy PC Client spec defines the EV_EVENT_TAG payload as a
TCPA_PC_EVENT: event_id, event_size and event-type-specific data.
A conformant entry carries the 8-byte header, and the hash-type
ids carry a full digest.

The catch is that the log is an ACPI table the firmware leaves in
memory: the TPM never measures the log itself, so the kernel cannot
tell a conformant log from a corrupted one. The iterators already
work on that assumption - they stop once the declared event_size
runs past the buffer end - and this check applies the same rule to
what the EVENT_TAG branch reads off the payload.