Linux EFI development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Lennart Poettering <mzxreary@0pointer.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Mikko Rapeli <mikko.rapeli@linaro.org>,
	 linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-integrity@vger.kernel.org
Subject: Re: [PATCH] efi: expose TPM event log to userspace via sysfs
Date: Thu, 25 Apr 2024 09:46:35 -0400	[thread overview]
Message-ID: <66f1d772de1df260a23d2e3c2240e064ee8f67d8.camel@HansenPartnership.com> (raw)
In-Reply-To: <ZipcXqpbEkwkXrMI@gardel-login>

On Thu, 2024-04-25 at 15:36 +0200, Lennart Poettering wrote:
> On Do, 25.04.24 14:47, Ilias Apalodimas (ilias.apalodimas@linaro.org)
> wrote:
> 
> > > Yeah, the physical address is of no interest to us. We just need
> > > to
> > > know the existance, and that independently of any actualy tpm
> > > device
> > > having shown up. i.e. existance of
> > > /sys/kernel/security/tpm0/binary_bios_measurements would be good
> > > enough for is if it was available without "tpm0" actually being
> > > around...
> > 
> > IIRC 'binary_bios_measurements' is only created after the TPM
> > drivers
> > probe the device, so that wouldn't work.
> > Ard is right though the TPMEventLog is an EFI stub construct, so
> > exposing this is Linux-specific (and stub-specific).
> > The TPMFinalLog OTOH is described by the TCG spec so exposing that
> > even using the address address would work for systemd
> 
> Hmm, let me ask explicitly: is there any good reason for
> 'binary_bios_measurements' being tied to specific TPM devices? i mean
> it just exposes some firmware-provided memory area, no?

Realistically, no.  The current mechanism for exposing it in securityfs
is tpm chip init, which means it can't appear before a TPM driver
attaches, but there's no real reason why that has to be so.

> So, if the answer to that question is "no", maybe we can just move
> the file to some generic place that is not tied to "tpm0" being
> around, and then make the current file a symlink to that new place
> for compat?

We could just keep it where it is.  I don't believe a log ever appears
at anything other than tpm0 because the event log securityfs attach is
triggered on first tpm appearance, which has to be 0.  So the name is
purely conventional and could be hard coded.  The eventlog code itself
is all linked to the actual chip device (including some of the checks
for event log type---we have to work with both 1.2 and 2.0), but it
should be possible to get the information another way.

James


> i.e. /sys/kernel/security/tpm0/binary_bios_measurements could be a
> symlink to → /sys/kernel/security/binary_bios_measurements and the
> latter could be something the kernel always exposes, before any tpm
> drivers are loaded?





  reply	other threads:[~2024-04-25 13:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 11:27 [PATCH] efi: expose TPM event log to userspace via sysfs Mikko Rapeli
2024-04-22 12:42 ` James Bottomley
2024-04-22 13:08   ` Mikko Rapeli
2024-04-22 13:32     ` Ilias Apalodimas
2024-04-22 13:38       ` James Bottomley
2024-04-22 13:54         ` Ilias Apalodimas
2024-04-22 14:31           ` James Bottomley
2024-04-22 15:22             ` Ilias Apalodimas
2024-04-24 17:15               ` Ard Biesheuvel
2024-04-25  8:56                 ` Mikko Rapeli
2024-04-25 13:50                   ` Jarkko Sakkinen
2024-04-25  9:58                 ` Lennart Poettering
2024-04-25 10:36                   ` Ard Biesheuvel
2024-04-25 11:13                     ` Lennart Poettering
2024-04-25 11:47                       ` Ilias Apalodimas
2024-04-25 13:36                         ` Lennart Poettering
2024-04-25 13:46                           ` James Bottomley [this message]
2024-04-25 13:24                   ` James Bottomley
2024-04-25 13:39                     ` Mikko Rapeli
2024-04-25 13:40                     ` Lennart Poettering
2024-04-25 14:01                   ` Jarkko Sakkinen
2024-04-26  7:35                     ` Jarkko Sakkinen
2024-04-26  7:40                       ` Jarkko Sakkinen
2024-04-26  8:19                         ` Mikko Rapeli
2024-04-26  8:23                           ` Jarkko Sakkinen
2024-04-22 14:57           ` Mikko Rapeli
2024-04-26 11:41 ` Jarkko Sakkinen
2024-04-26 11:48 ` Jarkko Sakkinen

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=66f1d772de1df260a23d2e3c2240e064ee8f67d8.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=ardb@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikko.rapeli@linaro.org \
    --cc=mzxreary@0pointer.de \
    /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