From: Usama Arif <usamaarif642@gmail.com>
To: Ard Biesheuvel <ardb@kernel.org>,
Gregory Price <gourry@gourry.net>, Dave Young <dyoung@redhat.com>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
leitao@debian.org, sathyanarayanan.kuppuswamy@linux.intel.com,
ilias.apalodimas@linaro.org
Subject: Re: [PATCH v2 2/4] tpm: do not ignore memblock_reserve return value
Date: Mon, 16 Sep 2024 11:47:29 +0100 [thread overview]
Message-ID: <c23b8ec6-117f-4843-af37-507961520482@gmail.com> (raw)
In-Reply-To: <CAMj1kXH+QE+C78n84jRUn6ACUPbO9pU_EeeTcTa-nWitCKpt-Q@mail.gmail.com>
On 16/09/2024 09:29, Ard Biesheuvel wrote:
> (cc Dave)
>
> On Sat, 14 Sept 2024 at 15:26, Gregory Price <gourry@gourry.net> wrote:
>>
>> tpm code currently ignores a relevant failure case silently.
>> Add an error to make this failure non-silent.
>>
>> Signed-off-by: Gregory Price <gourry@gourry.net>
>> ---
>> drivers/firmware/efi/tpm.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
>> index 9c3613e6af15..b0cc2cc11d7e 100644
>> --- a/drivers/firmware/efi/tpm.c
>> +++ b/drivers/firmware/efi/tpm.c
>> @@ -61,7 +61,12 @@ int __init efi_tpm_eventlog_init(void)
>> }
>>
>> tbl_size = sizeof(*log_tbl) + log_tbl->size;
>> - memblock_reserve(efi.tpm_log, tbl_size);
>> + if (memblock_reserve(efi.tpm_log, tbl_size)) {
>> + pr_err("TPM Event Log memblock reserve fails (0x%lx, 0x%x)\n",
>> + efi.tpm_log, tbl_size);
>> + ret = -ENOMEM;
>> + goto out;
>> + }
>>
>
> Given the discussion in the other thread, I wonder if this should be
> efi_mem_reserve() instead - might as well fix that too.
>
> Dave?
I dont believe efi_mem_reserve is needed after your patch in
https://lore.kernel.org/all/20240912155159.1951792-2-ardb+git@google.com/
which will cover both kexec_load and kexec_file_load cases.
Thanks,
Usama
next prev parent reply other threads:[~2024-09-16 10:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 23:19 [PATCH v2 0/4] libstub,tpm: fix small bugs and improve error reporting Gregory Price
2024-09-13 23:19 ` [PATCH v2 1/4] tpm: fix signed/unsigned bug when checking event logs Gregory Price
2024-09-23 6:57 ` Ilias Apalodimas
2024-09-13 23:19 ` [PATCH v2 2/4] tpm: do not ignore memblock_reserve return value Gregory Price
2024-09-16 8:29 ` Ard Biesheuvel
2024-09-16 10:47 ` Usama Arif [this message]
2024-09-13 23:19 ` [PATCH v2 3/4] tpm: fix unsigned/signed mismatch errors related to __calc_tpm2_event_size Gregory Price
2024-09-13 23:19 ` [PATCH v2 4/4] libstub,tpm: do not ignore failure case when reading final event log Gregory Price
2024-10-15 18:29 ` [PATCH v2 0/4] libstub,tpm: fix small bugs and improve error reporting Ard Biesheuvel
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=c23b8ec6-117f-4843-af37-507961520482@gmail.com \
--to=usamaarif642@gmail.com \
--cc=ardb@kernel.org \
--cc=dyoung@redhat.com \
--cc=gourry@gourry.net \
--cc=ilias.apalodimas@linaro.org \
--cc=leitao@debian.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®