All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: linux-integrity <linux-integrity@vger.kernel.org>,
	Matthew Garrett <mjg59@google.com>
Subject: Re: Is efi_tpm_eventlog_init calling memblock_reserve correctly for the TPM final log?
Date: Wed, 12 Oct 2022 11:12:03 +0300	[thread overview]
Message-ID: <Y0Z202u2qpZT505i@kernel.org> (raw)
In-Reply-To: <1d0b01793100651682413ab1e14c1b1d0e9f68f0.camel@redhat.com>

On Fri, Oct 07, 2022 at 09:50:49AM -0700, Jerry Snitselaar wrote:
> On Wed, 2022-06-22 at 21:26 -0700, Jerry Snitselaar wrote:
> > Is this calling memblock_reserve() correctly for the final events
> > log?
> > 
> > For the tpm events log it does:
> > 
> > memblock_reserve(efi.tpm_log, tbl_size);
> > 
> > For the final events log it does:
> > 
> >           memblock_reserve((unsigned long)final_tbl,
> >                            tbl_size + sizeof(*final_tbl));
> > 
> > 
> > which ends up with something like:
> > 
> > [    0.000000] memblock_reserve:
> > [0x000000005d7b5018-0x000000005d7b958a]
> > efi_tpm_eventlog_init+0x82/0x370
> > [    0.000000] memblock_reserve:
> > [0xffffffffff2c0000-0xffffffffff2c00e4]
> > efi_tpm_eventlog_init+0x324/0x370
> > 
> > 
> > Regards,
> > Jerry
> > 
> 
> Hi Matthew and Jarrko,
> 
> Is efi_tpm_eventlog_init() calling memblock_reserve() with the correct
> argument for the TPM final log, or should it be the following instead:
> 
> diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
> index 8f665678e9e3..e8d69bd548f3 100644
> --- a/drivers/firmware/efi/tpm.c
> +++ b/drivers/firmware/efi/tpm.c
> @@ -97,7 +97,7 @@ int __init efi_tpm_eventlog_init(void)
>  		goto out_calc;
>  	}
>  
> -	memblock_reserve((unsigned long)final_tbl,
> +	memblock_reserve(efi.tpm_final_log,
>  			 tbl_size + sizeof(*final_tbl));
>  	efi_tpm_final_log_size = tbl_size;

With a *long while* since last looked into this, it does look wrong as
'final_tbl' is just transient thing in the fixmap used internally in the
function.

BR, Jarkko

      reply	other threads:[~2022-10-12  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  4:26 efi_tpm_eventlog_init question Jerry Snitselaar
2022-10-07 16:50 ` Is efi_tpm_eventlog_init calling memblock_reserve correctly for the TPM final log? Jerry Snitselaar
2022-10-12  8:12   ` Jarkko Sakkinen [this message]

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=Y0Z202u2qpZT505i@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mjg59@google.com \
    /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.