grub2/grub2-linuxefi-fix-boot-params.patch
Andrei Borzenkov 2f69638ea4 Accepting request 477066 from home:michael-chang:branches:Base:System
- Fix invalid Xen EFI config files if xen_args include GRUB2 quoting
  (bsc#900418) (bsc#951748)
  * grub2-efi-xen-cfg-unquote.patch
- Fix linuxefi erroneously initialize linux's boot_params with non-zero
  values. (bsc#1025563)
  * grub2-linuxefi-fix-boot-params.patch
- Removed grub2-fix-multi-device-root-kernel-argument.patch as it has
  regression on how GRUB_DISABLE_LINUX_UUID=true interpreted (bsc#1015138)

OBS-URL: https://build.opensuse.org/request/show/477066
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=262
2017-03-06 07:17:24 +00:00

21 lines
938 B
Diff

Index: grub-2.02~rc1/grub-core/loader/i386/efi/linux.c
===================================================================
--- grub-2.02~rc1.orig/grub-core/loader/i386/efi/linux.c
+++ grub-2.02~rc1/grub-core/loader/i386/efi/linux.c
@@ -324,7 +324,14 @@ grub_cmd_linux (grub_command_t cmd __att
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 (&params->setup_sects, &lh.setup_sects, sizeof (lh) - 0x01f1);
params->type_of_loader = 0x21;