All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahisa Kojima <masahisa.kojima@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Alexander Graf <agraf@csgraf.de>,  Bin Meng <bmeng.cn@gmail.com>,
	Christian Gmeiner <christian.gmeiner@gmail.com>
Subject: Re: [PATCH v2 1/3] efi_loader: add SMBIOS table measurement
Date: Fri, 1 Oct 2021 20:10:03 +0900	[thread overview]
Message-ID: <CADQ0-X86Y9e6uVqxiUhuRXnMdB3cCe64gKcmpNGB6kPk8YFz0g@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ2St5g5-S9sGAKDdnaOjf50QG0jacgQ+KnCodXs3CtjWg@mail.gmail.com>

On Thu, 23 Sept 2021 at 01:19, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Masahisa,
>
> On Tue, 21 Sept 2021 at 01:17, Masahisa Kojima
> <masahisa.kojima@linaro.org> wrote:
> >
> > TCG PC Client spec requires to measure the SMBIOS
> > table that contain static configuration information
> > (e.g. Platform Manufacturer Enterprise Number assigned by IANA,
> > platform model number, Vendor and Device IDs for each SMBIOS table).
> >
> > The device and environment dependent information such as
>
> device- and environment-dependent
>
> > serial number is cleared to zero or space character for
> > the measurement.
> >
> > Existing smbios_string() function returns pointer to the string
> > with const qualifier, but exisintg use case is updating version
> > string and const qualifier must be removed.
> > This commit removes const qualifier from smbios_string()
> > return value and reuses to clear the strings for the measurement.
> >
> > This commit also fixes the following compiler warning:
> >
> > lib/smbios-parser.c:59:39: warning: cast to pointer from integer of
> > different size [-Wint-to-pointer-cast]
> >   const struct smbios_header *header = (struct smbios_header *)entry->struct_table_address;
> >
> > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> > ---
> >
> > Changes in v2:
> > - use flexible array for table_entry field
> > - modify funtion name to find_smbios_table()
> > - remove unnecessary const qualifier from smbios_string()
> > - create non-const version of next_header()
> >
> >  include/efi_loader.h          |   2 +
> >  include/efi_tcg2.h            |  15 ++++
> >  include/smbios.h              |  17 +++-
> >  lib/efi_loader/Kconfig        |   1 +
> >  lib/efi_loader/efi_boottime.c |   2 +
> >  lib/efi_loader/efi_smbios.c   |   2 -
> >  lib/efi_loader/efi_tcg2.c     |  84 +++++++++++++++++++
> >  lib/smbios-parser.c           | 152 +++++++++++++++++++++++++++++++---
> >  8 files changed, 261 insertions(+), 14 deletions(-)
>
> Where are the tests for this new code, please?
>
> Would it make sense to have a function that iterates through the data
> that does need to be hashed, instead?

I agree that it is straightforward if we iterates the data to be hashed.
But the data NOT to be hashed is less than the data to be hashed,
and this is what edk2 implements, we can easily compare with edk2.
So I would like to keep current implementation.

Thanks,
Masahisa Kojima

>
> Regards,
> Simon

  parent reply	other threads:[~2021-10-01 11:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21  7:19 [PATCH v2 0/3] Enhance Measured Boot Masahisa Kojima
2021-09-21  7:19 ` [PATCH v2 1/3] efi_loader: add SMBIOS table measurement Masahisa Kojima
2021-09-22 16:19   ` Simon Glass
2021-09-23  9:16     ` Ilias Apalodimas
2021-09-24 23:36       ` Simon Glass
2021-09-27  8:52         ` Ilias Apalodimas
2021-09-27 20:17           ` Simon Glass
2021-09-28 17:40             ` Ilias Apalodimas
2021-10-01 15:16               ` Simon Glass
2021-10-01 11:10     ` Masahisa Kojima [this message]
2021-09-21  7:19 ` [PATCH v2 2/3] efi_loader: add UEFI GPT measurement Masahisa Kojima
2021-09-27 20:21   ` Ilias Apalodimas
2021-10-01  7:37     ` Masahisa Kojima
2021-10-01  9:08       ` Ilias Apalodimas
2021-09-21  7:19 ` [PATCH v2 3/3] efi_loader: add DeployedMode and AuditMode variable measurement Masahisa Kojima
2021-09-27 13:53   ` Ilias Apalodimas
2021-09-28 11:45     ` 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=CADQ0-X86Y9e6uVqxiUhuRXnMdB3cCe64gKcmpNGB6kPk8YFz0g@mail.gmail.com \
    --to=masahisa.kojima@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=christian.gmeiner@gmail.com \
    --cc=ilias.apalodimas@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.