Linux EFI development
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@google.com>
To: linux-efi@vger.kernel.org, mingo@kernel.org
Cc: x86@kernel.org, Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH v2 2/2] x86/boot: efistub: Assign global boot_params variable
Date: Tue, 17 Oct 2023 15:25:13 +0200	[thread overview]
Message-ID: <20231017132510.3845531-6-ardb@google.com> (raw)
In-Reply-To: <20231017132510.3845531-4-ardb@google.com>

From: Ard Biesheuvel <ardb@kernel.org>

Now that the x86 EFI stub calls into some APIs exposed by the
decompressor (e.g., kaslr_get_random_long()), it is necessary to ensure
that the global boot_params variable is set correctly before doing so.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/libstub/x86-stub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 3bfc59637dd1..2e374ce099ab 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -818,6 +818,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
 	unsigned long kernel_entry;
 	efi_status_t status;
 
+	boot_params_p = boot_params;
+
 	efi_system_table = sys_table_arg;
 	/* Check if we were booted by the EFI firmware */
 	if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
-- 
2.42.0.655.g421f12c284-goog


  parent reply	other threads:[~2023-10-17 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 13:25 [PATCH v2 0/2] x86/boot: Fix boot_params init in EFI stub Ard Biesheuvel
2023-10-17 13:25 ` [PATCH v2 1/2] x86/boot: Rename conflicting boot_params pointer to boot_params_p Ard Biesheuvel
2023-10-17 13:25 ` Ard Biesheuvel [this message]
2023-10-18  9:55 ` [PATCH v2 0/2] x86/boot: Fix boot_params init in EFI stub Ingo Molnar
2023-10-18 12:10   ` Ard Biesheuvel
2023-10-18 12:31     ` Ingo Molnar
2023-10-18 12:57       ` 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=20231017132510.3845531-6-ardb@google.com \
    --to=ardb@google.com \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=x86@kernel.org \
    /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