Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:michael-chang:efi:grub:nx
grub2
0021-x86-efi-Fix-an-incorrect-array-size-in-ker...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0021-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch of Package grub2
From 0f236c97bf55fccd2fd6e18dff4d19b85fedd097 Mon Sep 17 00:00:00 2001 From: Peter Jones <pjones@redhat.com> Date: Tue, 11 Oct 2022 17:00:50 -0400 Subject: [PATCH 21/28] x86-efi: Fix an incorrect array size in kernel allocation In 81a6ebf62bbe166ddc968463df2e8bd481bf697c ("efi: split allocation policy for kernel vs initrd memories."), I introduced a split in the kernel allocator to allow for different dynamic policies for the kernel and the initrd allocations. Unfortunately, that change increased the size of the policy data used to make decisions, but did not change the size of the temporary storage we use to back it up and restore. This results in some of .data getting clobbered at runtime, and hilarity ensues. This patch makes the size of the backup storage be based on the size of the initial policy data. Signed-off-by: Peter Jones <pjones@redhat.com> --- grub-core/loader/i386/efi/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c index 5e83f38c3..f864a6d5d 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -93,7 +93,7 @@ static struct allocation_choice max_addresses[] = { INITRD_MEM, GRUB_EFI_MAX_ALLOCATION_ADDRESS, GRUB_EFI_ALLOCATE_MAX_ADDRESS }, { NO_MEM, 0, 0 } }; -static struct allocation_choice saved_addresses[4]; +static struct allocation_choice saved_addresses[sizeof(max_addresses) / sizeof(max_addresses[0])]; #define save_addresses() grub_memcpy(saved_addresses, max_addresses, sizeof(max_addresses)) #define restore_addresses() grub_memcpy(max_addresses, saved_addresses, sizeof(max_addresses)) -- 2.42.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor