public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
	devel@edk2.groups.io, public@thson.de
Cc: ardb+tianocore@kernel.org
Subject: Re: [edk2-devel] Problem: TPM 2.0 event log by OVMF is shown empty in Linux kernel versions after 5.8
Date: Wed, 28 Apr 2021 13:47:09 +0200	[thread overview]
Message-ID: <e13ea8d8-91ac-2ac6-131c-f33daf5e3af9@redhat.com> (raw)
In-Reply-To: <8f68431ac5e7ef1f28037856f92da8327cdfb737.camel@HansenPartnership.com>

On 04/27/21 01:44, James Bottomley wrote:
> On Mon, 2021-04-26 at 21:56 +0200, Thore Sommer wrote:
>> Dear Maintainers,
>>
>> during my testing with OVMF and swtpm I found out that kernel
>> versions newer than 5.8 don't show any information in 
>> "/sys/kernel/security/tpm0/binary_bios_measurements" if swtpm
>> emulates a TPM 2.0 device. The file is still created but is empty.
>> The expected result would be that 
>> "/sys/kernel/security/tpm0/binary_bios_measurements" contains the
>> TPM event log. TPM 1.2 devices are not affected.
> 
> I don't confirm this.  I have Linux version 5.12.0-rc5+ installed and I
> see the attached in my binary_bios_measurements (I've run it through
> tpm2-eventlog so you can see the actual events).
> 
>> With the help of git bisect I found out that the breaking kernel
>> commit is 85467f63a05c43364ba0b90d0c05bb89191543fa.
>> Reverting this on top the 5.12 release restores the expected
>> functionality.
>>
>> Thanks to apalos and leiflindholm on the #edk2 IRC channel for
>> helping me with that.
>>
>> I don't know if this is a bug in OVMF or in the Linux kernel, because
>> on a real device with a TPM 2.0 the output was as expected.
>>
>> Tested with edk2-ovmf 202102, swtpm 0.5.2 and qemu 5.2.0 on Ubuntu
>> 20.04.
>>
>> If further information is needed to resolve this problem, I'd be
>> happy to provide them.
> 
> What that commit did was to allow the event log to be provided by the
> ACPI table if one existed rather than always defaulting to it being
> provided by the EFI configuration table.  What I suspect has happened
> from this:
> 
>> [    0.017358] ACPI: Reserving TPM2 table memory at [mem 
>> 0x7eb77000-0x7eb7704b]
> 
> Is that somehow you've got an empty TPM2 table installed in ACPI but I
> don't know how you've done this.  On my OVMF boot I'm using the direct
> kernel command line and I have secure boot enabled but not activated,
> which is why you only see PCRs 0-7 in the log.

IIRC the QEMU ACPI linker/loader exposes a TPM2 ACPI table as well;
maybe that conflicts with the edk2 TPM2 machinery built into OVMF,
somehow. An OVMF log (enabling DEBUG_VERBOSE) might help. Running
acpidump + iasl in the guest might help as well (for determining some
inconsistency). My gut feeling is that it's a fight between QEMU's ACPI
generator and the edk2 TPM infrastructure, over the ownership of the
TPM-related ACPI table(s).

Laszlo


  parent reply	other threads:[~2021-04-28 11:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 19:56 Problem: TPM 2.0 event log by OVMF is shown empty in Linux kernel versions after 5.8 Thore Sommer
2021-04-26 23:44 ` [edk2-devel] " James Bottomley
2021-04-27  7:40   ` Thore Sommer
2021-04-27 14:00     ` Lendacky, Thomas
2021-04-27 15:35       ` Thore Sommer
2021-04-27 16:28       ` James Bottomley
2021-04-28 11:47   ` Laszlo Ersek [this message]
2021-04-28 14:56     ` Thore Sommer
2021-04-28 17:19       ` James Bottomley
2021-04-28 20:31         ` Thore Sommer
2021-04-28 22:03         ` James Bottomley
2021-04-29  8:20           ` Thore Sommer
2021-04-29  9:43           ` Thore Sommer
2021-04-30 15:51             ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e13ea8d8-91ac-2ac6-131c-f33daf5e3af9@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox