From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: Simon Glass <sjg@chromium.org>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Alexander Graf <agraf@csgraf.de>,
Dhananjay Phadke <dphadke@linux.microsoft.com>,
U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH 1/5] efi_loader: increase eventlog buffer size
Date: Thu, 15 Jul 2021 09:46:09 +0300 [thread overview]
Message-ID: <YO/ZsUthReUb3P3n@enceladus> (raw)
In-Reply-To: <CADQ0-X_0BcVjBvcfy9tUpnLMWK3hvWBwVuev1FXz2ws7ny_2YQ@mail.gmail.com>
On Thu, Jul 15, 2021 at 02:09:57PM +0900, Masahisa Kojima wrote:
> Hi Simon, Ilias,
>
> On Wed, 14 Jul 2021 at 23:50, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Masahisa,
> >
> > On Mon, 12 Jul 2021 at 02:40, Masahisa Kojima
> > <masahisa.kojima@linaro.org> wrote:
> > >
> > > Hi Simon,
> > >
> > > On Sun, 11 Jul 2021 at 09:01, Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > Hi Masahisa,
> > > >
> > > > On Wed, 7 Jul 2021 at 20:21, Masahisa Kojima <masahisa.kojima@linaro.org> wrote:
> > > > >
> > > > > On Wed, 7 Jul 2021 at 22:47, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 7/7/21 3:36 PM, Masahisa Kojima wrote:
> > > > > > > This is a preperation to add eventlog support
> > > > > > > described in TCG PC Client PFP spec.
> > > > > > >
> > > > > > > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> > > > > > > ---
> > > > > > > lib/efi_loader/Kconfig | 2 +-
> > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > > > > > > index b2ab48a048..a87bf3cc98 100644
> > > > > > > --- a/lib/efi_loader/Kconfig
> > > > > > > +++ b/lib/efi_loader/Kconfig
> > > > > > > @@ -327,7 +327,7 @@ config EFI_TCG2_PROTOCOL
> > > > > > > config EFI_TCG2_PROTOCOL_EVENTLOG_SIZE
> > > > > > > int "EFI_TCG2_PROTOCOL EventLog size"
> > > > > > > depends on EFI_TCG2_PROTOCOL
> > > > > > > - default 4096
> > > > > > > + default 16384
> > > > > >
> > > > > > I found this text in EDK II:
> > > > > >
> > > > > > Minimum length(in bytes) of the system preboot TCG event log area(LAML)
> > > > > > -----------------------------------------------------------------------
> > > > > >
> > > > > > For PC Client Implementation spec up to and including 1.2 the minimum
> > > > > > log size is 64KB. (SecurityPkg/SecurityPkg.dec)
> > > > >
> > > > > Thank you for your feedback.
> > > > > I have not checked this.
> > > > > TCG spec also says "The Log Area Minimum Length for the TCG event log
> > > > > MUST be at least 64KB." in ACPI chapter.
> > > > > I will update to set 64KB as default.
> > > > >
> > > >
> > > > Is this the same as the BLOBLISTT_TPM2_TCG_LOG thing? If so, can we
> > > > put this in the bloblist? We want to avoid adding code in EFI which is
> > > > in U-Boot.
> > >
> > > I think bloblist is used for data passing from SPL/TPL to u-boot.
> >
> > It can also be used to place things in memory that end up accessed by
> > Linux, e.g. ACPI tables. So I think it fits.
>
> I understand bloblist can be used for eventlog, I will check further.
>
> >
> > > Is your comment saying that the eventlog generated
> > > in u-boot(done in efi_tcg2.c with this patch series) should be appended
> > > into the buffer pointed by BLOBLISTT_TPM2_TCG_LOG blob?
> >
> > I suppose so, but this logic should be implemented in the TPM layer I
> > think, not just in EFI. Otherwise we end up with another parallel
> > implementation.
>
> Current u-boot/lib/efi_loader/efi_tcg2.c includes the code
> not directly related to EFI.
> I would like to suggest to divide u-boot/lib/efi_loader/efi_tcg2.c
> into two files.
>
> 1) u-boot/lib/efi_loader/efi_tcg2.c
> This file implements the EFI interfaces required in TCG EFI Protocol
> Specification(https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/).
>
The only problem I see with the way the efi tcg2 eventlog is currently
created, is that it's all done during the efi init. Ideally this should
happen earlier, especially if SPL or TF-A create their own eventlog.
The status with TF-A atm is that it only creates an eventlog which then
copies to secure and non-secure memory, but it doesnt extend the PCRs.
We should pick that eventlog from u-boot (or better op-tee), extend the
PCRs based on the information of the log and then use it as our basis and
start appending events there.
> 2) u-boot/lib/tcg2.c(new file)
> This file implements the functionality required in TCG PC Client
> Platform Firmware Profile
> Specification(https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/).
> This file contains the common functions to extend eventlog and PCRs, etc.
Splitting up the pc client spec bits is probably a good idea.
What do you have in mind? Moving tcg2_pcr_extend() and
tcg2_agile_log_append() as well, or just the pc client related wrappers?
>
> In addition, this is different topic, I found some tpm related files
> under u-boot/lib directory, I think it better to have new directory
> like "tcg" and move tpm related files such as tpm_api.c, tpm-v2.c
> and tpm-common.c into lib/tcg(new directory).
+1
Regards
/Ilias
>
> Thanks,
> Masahisa Kojima
>
> >
> > Regards,
> > Simon
next prev parent reply other threads:[~2021-07-15 6:46 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 13:36 [PATCH 0/5] add measurement support Masahisa Kojima
2021-07-07 13:36 ` [PATCH 1/5] efi_loader: increase eventlog buffer size Masahisa Kojima
2021-07-07 13:47 ` Heinrich Schuchardt
2021-07-08 2:21 ` Masahisa Kojima
2021-07-11 0:01 ` Simon Glass
2021-07-12 8:40 ` Masahisa Kojima
2021-07-12 9:27 ` Ilias Apalodimas
2021-07-14 14:52 ` Simon Glass
2021-07-15 6:20 ` Ilias Apalodimas
2021-07-15 12:57 ` Simon Glass
2021-07-15 14:33 ` Heinrich Schuchardt
2021-07-15 15:18 ` Simon Glass
2021-07-15 15:29 ` Heinrich Schuchardt
2021-07-15 16:09 ` Simon Glass
2021-07-14 14:50 ` Simon Glass
2021-07-15 5:09 ` Masahisa Kojima
2021-07-15 6:46 ` Ilias Apalodimas [this message]
2021-07-15 7:50 ` Masahisa Kojima
2021-07-07 13:36 ` [PATCH 2/5] efi_loader: add secure boot variable measurement Masahisa Kojima
2021-07-07 17:37 ` Simon Glass
2021-07-07 17:40 ` Ilias Apalodimas
2021-07-07 17:49 ` Simon Glass
2021-07-07 18:44 ` Ilias Apalodimas
2021-07-08 17:46 ` Heinrich Schuchardt
2021-07-09 2:34 ` Masahisa Kojima
2021-07-07 13:36 ` [PATCH 3/5] efi_loader: add " Masahisa Kojima
2021-07-07 18:56 ` Ilias Apalodimas
2021-07-08 2:44 ` Masahisa Kojima
2021-07-08 17:46 ` Heinrich Schuchardt
2021-07-09 2:44 ` Masahisa Kojima
2021-07-13 8:31 ` Masahisa Kojima
2021-07-13 14:24 ` Heinrich Schuchardt
2021-07-13 23:54 ` AKASHI Takahiro
2021-07-14 0:40 ` Masahisa Kojima
2021-07-07 13:36 ` [PATCH 4/5] efi_loader: add ExitBootServices() measurement Masahisa Kojima
2021-07-08 17:40 ` Heinrich Schuchardt
2021-07-09 3:05 ` Masahisa Kojima
2021-07-07 13:36 ` [PATCH 5/5] efi_loader: refactor efi_append_scrtm_version() Masahisa Kojima
2021-07-08 17:31 ` Heinrich Schuchardt
2021-07-09 2:05 ` Masahisa Kojima
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=YO/ZsUthReUb3P3n@enceladus \
--to=ilias.apalodimas@linaro.org \
--cc=agraf@csgraf.de \
--cc=dphadke@linux.microsoft.com \
--cc=masahisa.kojima@linaro.org \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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