From: Jonathan McDowell <noodles@earth.li>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Breno Leitao <leitao@debian.org>,
Usama Arif <usamaarif642@gmail.com>,
linux-efi@vger.kernel.org, kexec@lists.infradead.org,
bhe@redhat.com, vgoyal@redhat.com, tglx@linutronix.de,
dave.hansen@linux.intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org, rmikey@meta.com, gourry@gourry.net,
linux-integrity@vger.kernel.org
Subject: Re: [RFC] efi/tpm: add efi.tpm_log as a reserved region in 820_table_firmware
Date: Wed, 9 Oct 2024 10:10:57 +0100 [thread overview]
Message-ID: <ZwZIoQobJrltBpTX@earth.li> (raw)
In-Reply-To: <CAMj1kXHtNrsdsHQWMXrq9jAyzxEJnTW0M7-OEA0kpb3KS2cZ=w@mail.gmail.com>
On Wed, Sep 18, 2024 at 09:36:06AM +0200, Ard Biesheuvel wrote:
> On Wed, 18 Sept 2024 at 05:14, Eric W. Biederman <ebiederm@xmission.com> wrote:
> > Ard Biesheuvel <ardb@kernel.org> writes:
> > > On Tue, 17 Sept 2024 at 17:24, Eric W. Biederman <ebiederm@xmission.com> wrote:
> > >> Ard Biesheuvel <ardb@kernel.org> writes:
> > >> This should not be the kexec-on-panic kernel as that runs in memory
> > >> that is reserved solely for it's own use. So we are talking something
> > >> like using kexec as a bootloader.
> > >
> > > kexec as a bootloader under TPM based measured boot will need to do a
> > > lot more than pass the firmware's event log to the next kernel. I'd
> > > expect a properly engineered kexec to replace this table entirely, and
> > > include the hashes of the assets it has loaded and measured into the
> > > respective PCRs.
> > >
> > > But let's stick to solving the actual issue here, rather than
> > > philosophize on how kexec might work in this context.
> >
> > I am fine with that. The complaint I had seen was that the table was
> > being corrupted and asking how to solve that. It seems I haven't read
> > the part of the conversation where it was made clear that no one wants
> > the tpm_log after kexec.
> >
> It was not made clear, that is why I raised the question. I argued
> that the TPM log has limited utility after a kexec, given that we will
> be in one of two situations:
> - the kexec boot chain cares about the TPM and measured boot, and will
> therefore have extended the TPM's PCRs and the TPM log will be out of
> sync;
> - the kexec boot chain does not care, and so there is no point in
> forwarding the TPM log.
>
> Perhaps there is a third case where kdump wants to inspect the TPM log
> that the crashed kernel accessed? But this is rather speculative.
Generally the kernel/host OS and the firmware are touching different
PCRs in the TPM.
The firmware eventlog covers what the firmware/bootloader measured;
itself, option ROMs, secure boot details, bootloader, initial
kernel/initrd (if we're talking grub as the initial bootloader). These
details are not changed by a kexec, and provide the anchor of the
software trust chain.
A kexec'd kernel will generally not touch the same PCRs. The primary way
I know to carry kexec measurements / logs over to new kernels is using
IMA, which will be configured to use one of the later PCRs (default of
10).
That means that the firmware event log is still completely valid to
subsequent kernels, and is still required to validate the
firmware/bootloader trust chain. You then probably _also_ want to make
use of the IMA log to validate the kexec'd kernel chain, but that's
separate.
> > If someone wants the tpm_log then we need to solve this problem.
> Agreed.
There's a real requirement and use for kexec'd kernels to be able to
continue to access the firmware TPM event log; to the extent that there
are also patches floating around to have this carried over via device
tree on non-UEFI platforms.
J.
--
Avoid temporary variables and strange women.
This .sig brought to you by the letter U and the number 37
Product of the Republic of HuggieTag
next prev parent reply other threads:[~2024-10-09 9:11 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 10:41 [RFC] efi/tpm: add efi.tpm_log as a reserved region in 820_table_firmware Usama Arif
2024-09-11 11:51 ` Ard Biesheuvel
2024-09-11 14:34 ` Usama Arif
2024-09-12 10:23 ` Usama Arif
2024-09-12 10:51 ` Ard Biesheuvel
2024-09-12 11:17 ` Usama Arif
2024-09-12 13:03 ` Breno Leitao
2024-09-12 13:10 ` Ard Biesheuvel
2024-09-12 13:54 ` Usama Arif
2024-09-12 14:05 ` Ard Biesheuvel
2024-09-12 14:14 ` Ard Biesheuvel
2024-09-13 10:56 ` Dave Young
2024-09-13 11:06 ` Usama Arif
2024-09-13 11:13 ` Dave Young
2024-09-13 11:49 ` Dave Young
2024-09-13 11:56 ` Usama Arif
2024-09-13 12:52 ` Dave Young
2024-09-14 6:46 ` Dave Young
2024-09-14 8:31 ` Ard Biesheuvel
2024-09-14 9:24 ` Dave Young
2024-09-14 9:46 ` Dave Young
2024-09-12 14:29 ` Breno Leitao
2024-09-12 15:21 ` Ard Biesheuvel
2024-09-12 15:35 ` Usama Arif
2024-09-12 15:45 ` Ard Biesheuvel
2024-09-12 16:22 ` James Bottomley
2024-09-13 11:57 ` Breno Leitao
2024-09-13 12:07 ` James Bottomley
2024-09-16 20:20 ` Eric W. Biederman
2024-09-17 6:45 ` Ard Biesheuvel
2024-09-17 15:24 ` Eric W. Biederman
2024-09-17 15:35 ` Ard Biesheuvel
2024-09-18 3:13 ` Eric W. Biederman
2024-09-18 7:36 ` Ard Biesheuvel
2024-10-09 9:10 ` Jonathan McDowell [this message]
2024-10-09 10:46 ` Breno Leitao
2024-10-09 14:05 ` Jonathan McDowell
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-all 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=ZwZIoQobJrltBpTX@earth.li \
--to=noodles@earth.li \
--cc=James.Bottomley@hansenpartnership.com \
--cc=ardb@kernel.org \
--cc=bhe@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=ebiederm@xmission.com \
--cc=gourry@gourry.net \
--cc=kexec@lists.infradead.org \
--cc=leitao@debian.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmikey@meta.com \
--cc=tglx@linutronix.de \
--cc=usamaarif642@gmail.com \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
/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