Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2026-08-06 16:18:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/grub2 (Old) and /work/SRC/openSUSE:Factory/.grub2.new.16738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "grub2" Thu Aug 6 16:18:22 2026 rev:397 rq:1369622 version:2.14 Changes: -------- --- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2026-08-01 18:27:24.987886700 +0200 +++ /work/SRC/openSUSE:Factory/.grub2.new.16738/grub2.changes 2026-08-06 16:18:32.932796830 +0200 @@ -1,0 +2,6 @@ +Wed Jul 29 02:40:42 UTC 2026 - Michael Chang <[email protected]> + +- Fix crash in booting kernel on some AMD systems (bsc#1271980) + * 0001-linux-allocate-EFI-kernel-buffer-as-GRUB_EFI_LOADER_.patch + +------------------------------------------------------------------- New: ---- 0001-linux-allocate-EFI-kernel-buffer-as-GRUB_EFI_LOADER_.patch ----------(New B)---------- New:- Fix crash in booting kernel on some AMD systems (bsc#1271980) * 0001-linux-allocate-EFI-kernel-buffer-as-GRUB_EFI_LOADER_.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.ehY5Xg/_old 2026-08-06 16:18:39.617030748 +0200 +++ /var/tmp/diff_new_pack.ehY5Xg/_new 2026-08-06 16:18:39.621030888 +0200 @@ -416,6 +416,7 @@ Patch: gcc16.patch Patch: 0001-lib-hwfeatures-gcry-Fix-write_cr0-writing-to-CR4.patch Patch: 0001-bash-completion-add-_init_completion-marker.patch +Patch: 0001-linux-allocate-EFI-kernel-buffer-as-GRUB_EFI_LOADER_.patch %if 0%{?suse_version} < 1600 Requires: gettext-runtime ++++++ 0001-linux-allocate-EFI-kernel-buffer-as-GRUB_EFI_LOADER_.patch ++++++ >From 2f9822405b6503f00265ca8a61c7121f83726e3a Mon Sep 17 00:00:00 2001 From: Michael Chang <[email protected]> Date: Tue, 28 Jul 2026 14:00:01 +0800 Subject: [PATCH] linux: allocate EFI kernel buffer as GRUB_EFI_LOADER_CODE On some EFI systems with stricter W^X/memory-protection policies, memory allocated as GRUB_EFI_LOADER_DATA may not be executable. When the Linux kernel image is placed in such memory, boot can hang after GRUB transfers control to the kernel. Make kernel_alloc() take an explicit EFI memory type and use GRUB_EFI_LOADER_CODE for the kernel image allocation, while keeping initrd, cmdline, and parameter allocations as GRUB_EFI_LOADER_DATA. This ensures the loaded kernel resides in executable memory on firmware that enforces execute permissions by memory type. Signed-off-by: Michael Chang <[email protected]> --- grub-core/loader/i386/efi/linux.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c index 91caf132c..149c81ece 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -81,7 +81,9 @@ kernel_free(void *addr, grub_efi_uintn_t size) } static void * -kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) +kernel_alloc(grub_efi_uintn_t size, + grub_efi_memory_type_t memtype, + const char * const errmsg) { void *addr = 0; unsigned int i; @@ -107,7 +109,7 @@ kernel_alloc(grub_efi_uintn_t size, const char * const errmsg) prev_max = max; addr = grub_efi_allocate_pages_real (max, pages, max_addresses[i].alloc_type, - GRUB_EFI_LOADER_DATA); + memtype); if (addr) grub_dprintf ("linux", "Allocated at %p\n", addr); } @@ -173,7 +175,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; size = grub_get_initrd_size (&initrd_ctx); - initrd_mem = kernel_alloc(size, N_("can't allocate initrd")); + initrd_mem = kernel_alloc(size, GRUB_EFI_LOADER_DATA, + N_("can't allocate initrd")); if (initrd_mem == NULL) goto fail; grub_dprintf ("linux", "initrd_mem = %p\n", initrd_mem); @@ -301,7 +304,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } #endif - params = kernel_alloc (sizeof(*params), "cannot allocate kernel parameters"); + params = kernel_alloc (sizeof(*params), GRUB_EFI_LOADER_DATA, + "cannot allocate kernel parameters"); if (!params) goto fail; grub_dprintf ("linux", "params = %p\n", params); @@ -322,7 +326,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("linux", "new lh is at %p\n", lh); grub_dprintf ("linux", "setting up cmdline\n"); - linux_cmdline = kernel_alloc (lh->cmdline_size + 1, N_("can't allocate cmdline")); + linux_cmdline = kernel_alloc (lh->cmdline_size + 1, + GRUB_EFI_LOADER_DATA, + N_("can't allocate cmdline")); if (!linux_cmdline) goto fail; grub_dprintf ("linux", "linux_cmdline = %p\n", linux_cmdline); @@ -369,7 +375,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } max_addresses[1].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; max_addresses[2].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; - kernel_mem = kernel_alloc (lh->init_size, N_("can't allocate kernel")); + kernel_mem = kernel_alloc (lh->init_size, GRUB_EFI_LOADER_CODE, + N_("can't allocate kernel")); restore_addresses(); if (!kernel_mem) goto fail; -- 2.55.0
