Re: [PATCH] tpm: eventlog: check the payload size before reading tag events
From: Jarkko Sakkinen
Date: Wed Nov 04 2026 - 06:04:21 EST
On Wed, Nov 04, 2026 at 10:58:09AM +0800, Guanglei Zhu wrote:
> 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.
Yeah, this is exactly what I wanted to know. Could you refine the
patch and send a new version with this?
It's really good stuff to have in the commit log when looking back
at old changes.
Br, Jarkko