<tt><font size=2>"Kevin O'Connor" <kevin@koconnor.net>
wrote on 11/20/2015 12:26:08 PM:<br><br>> <br>> On Fri, Nov 20, 2015 at 05:09:07PM +0000, Stefan Berger wrote:<br>> > "Kevin O'Connor" <kevin@koconnor.net> wrote on
11/20/2015 11:12:53 AM:<br>> > > I don't understand the error handling in tpm_extend_acpi_log()
and<br>> > > tpm_extend().  Why does a log overflow in tpm_extend_acpi_log()<br>> > > shutdown the tpm chip (via tpm_set_failure() )?  In
particular,<br>> > > tpm_extend_acpi_log can be called from clients via the 16bit
BIOS<br>> > > interface, and it's the only way a client could cause the
tpm chip to<br>> > > shutdown.  Why does tpm_extend() call reset_acpi_log()
on failure?  It<br>> > > seems odd that a failure in communication with the TPM chip
would<br>> > > result in an ACPI log reset - no other TPM chip failure
does that.<br>> > <br>> > The intention here was to invalidate the log that is supposed
to be <br>> > written along with PCR extensions, resulting in attestation not
being <br>> > possible due to a failure in the extend.<br>> <br>> Okay - so there isn't a specific need to handle a failure in<br>> tpm_extend_acpi_log() differently from a failure in tpm_extend()?<br>> That is, the goal is just to prevent attestation after a failed<br>> request?</font></tt><br><br><tt><font size=2>tpm_shutdown can be removed; tpm_extend could also
call tpm_set_failure() instead of tpm_shutdown()</font></tt><br><tt><font size=2><br>> <br>> > > Is it expected that the tcpa ACPI table could move or be
modified at<br>> > > runtime?  The code rescans for the table twice on every
call to<br>> > > tpm_extend_acpi_log() - if it can't move or be modified
then I think<br>> > > it would be simpler to cache the values.<br>> > <br>> > I will have a look whether we can cache that. I guess for as
long as it's <br>> > scanned for 'early' we are not write-protected, yet. You may
have seen I <br>> > am also rescanning the log every time something is appended to
it. Here <br>> > the reason was that we are running in ROM mode and I cannot write
to <br>> > static variables anymore that would allow to set the pointer
to the last <br>> > entry. So back when I wrote this I handled the ACPI table in
the same way <br>> > - rescanning.<br>> <br>> Oh, so the code could assume that the tcpa table is not moved nor<br>> modified _and_ that the BIOS is also the only writer to the log?</font></tt><br><br><tt><font size=2>Unless there is way that the bootloader could give
back control to the BIOS, the BIOS would be the only writer to the log.</font></tt><br><tt><font size=2><br>> <br>> BTW, to make a global variable read/writable at runtime, one can add<br>> the VARLOW attribute to the variable.</font></tt><br><br><tt><font size=2>Ok.</font></tt><br><br><tt><font size=2>Regards,</font></tt><br><tt><font size=2>    Stefan</font></tt><br><BR>