[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <111d4120936d23e6023619660778444eb226a22f.1678785672.git.baskov@ispras.ru>
Date: Tue, 14 Mar 2023 13:13:49 +0300
From: Evgeniy Baskov <baskov@...ras.ru>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Evgeniy Baskov <baskov@...ras.ru>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Alexey Khoroshilov <khoroshilov@...ras.ru>,
Peter Jones <pjones@...hat.com>,
Gerd Hoffmann <kraxel@...hat.com>,
"Limonciello, Mario" <mario.limonciello@....com>,
joeyli <jlee@...e.com>, lvc-project@...uxtesting.org,
x86@...nel.org, linux-efi@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: [PATCH v5 22/27] x86/build: set type_of_loader for EFISTUB
After switching to the local copy of boot_params, EFISTUB stopped
setting type_of_loader, using the default value of 0. Restore that
behavior by assigning the right value at the build time.
Signed-off-by: Evgeniy Baskov <baskov@...ras.ru>
---
arch/x86/boot/tools/build.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
index 476ef05f16fb..5ac4f08ed923 100644
--- a/arch/x86/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
@@ -588,6 +588,8 @@ int main(int argc, char **argv)
memcpy(output + setup_size + efi_boot_params + SETUP_HEADER_OFFSET,
setup_header, 0x290 - SETUP_HEADER_OFFSET
/* == max possible sizeof(struct setup_header) */);
+ /* Set type_of_loader to the one that EFISTUB uses for the local copy */
+ output[setup_size + efi_boot_params + SETUP_HEADER_OFFSET + 0x1F] = 0x21;
#endif
/* Calculate and write kernel checksum. */
--
2.39.2
Powered by blists - more mailing lists