代码拉取完成,页面将自动刷新
From 5a224d1beaebc0329fcbdeac4abda978e4b5ae8f Mon Sep 17 00:00:00 2001
From: nilusyi <nilusyi@tencent.com>
Date: Fri, 29 Mar 2024 16:57:10 +0800
Subject: [PATCH 012/272] linuxefi fix boot params
+ From https://www.kernel.org/doc/Documentation/x86/boot.txt:
+ The memory for struct boot_params could be allocated anywhere (even above 4G)
+ and initialized to all zero.
+ Then, the setup header at offset 0x01f1 of kernel image on should be
+ loaded into struct boot_params and examined
Michael Chang <mchang@suse.com>
---
grub-core/loader/i386/efi/linux.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
index 16f7554e2..6bb9c484f 100644
--- a/grub-core/loader/i386/efi/linux.c
+++ b/grub-core/loader/i386/efi/linux.c
@@ -298,7 +298,14 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
lh.code32_start = (grub_uint32_t)(grub_addr_t) kernel_mem;
}
- grub_memcpy(params, &lh, 2 * 512);
+ /* Grub linuxefi erroneously initialize linux's boot_params with non-zero values. (bsc#1025563)
+
+ From https://www.kernel.org/doc/Documentation/x86/boot.txt:
+ The memory for struct boot_params could be allocated anywhere (even above 4G)
+ and initialized to all zero.
+ Then, the setup header at offset 0x01f1 of kernel image on should be
+ loaded into struct boot_params and examined. */
+ grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x01f1);
params->type_of_loader = 0x21;
--
2.41.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。