Add patch to fix EFI boot on Macs (rhbz 953447)

This commit is contained in:
Josh Boyer 2013-04-24 11:21:48 -04:00
parent 7f7c4766c8
commit 0ba0b78d00
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 4b367720588ea97a32dc6393ac8975d6111ba72b Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Wed, 24 Apr 2013 10:30:02 -0400
Subject: [PATCH] efi: Check EFI revision in setup_efi_vars
We need to check the runtime sys_table for the EFI version the firmware
specifies instead of just checking for a NULL QueryVariableInfo. Older
implementations of EFI don't have QueryVariableInfo but the runtime is
a smaller structure, so the pointer to it may be pointing off into garbage.
This is apparently the case with several Apple firmwares that support EFI
1.10, and the current check causes them to no longer boot. Fix based on
a suggestion from Matthew Garrett.
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
---
arch/x86/boot/compressed/eboot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 8615f75..4060c8d 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -258,7 +258,7 @@ static efi_status_t setup_efi_vars(struct boot_params *params)
u64 store_size, remaining_size, var_size;
efi_status_t status;
- if (!sys_table->runtime->query_variable_info)
+ if (sys_table->runtime->hdr.revision < EFI_2_00_SYSTEM_TABLE_REVISION)
return EFI_UNSUPPORTED;
data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
--
1.8.1.4

View File

@ -62,7 +62,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
%global baserelease 1
%global baserelease 2
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -754,6 +754,9 @@ Patch25011: iwlwifi-fix-freeing-uninitialized-pointer.patch
Patch25012: events-protect-access-via-task-subsys-state-check.patch
#rhbz 953447
Patch25013: efi-Check-EFI-revision-in-setup_efi_vars.patch
# END OF PATCH DEFINITIONS
%endif
@ -1457,6 +1460,9 @@ ApplyPatch iwlwifi-fix-freeing-uninitialized-pointer.patch
ApplyPatch events-protect-access-via-task-subsys-state-check.patch
#rhbz 953447
ApplyPatch efi-Check-EFI-revision-in-setup_efi_vars.patch
# END OF PATCH APPLICATIONS
%endif
@ -2289,6 +2295,9 @@ fi
# and build.
%changelog
* Wed Apr 24 2013 Josh Boyer <jwboyer@redhat.com>
- Add patch to fix EFI boot on Macs (rhbz 953447)
* Mon Apr 22 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc8.git0.1
- Linux v3.9-rc8