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

Josh Boyer jwboyer at fedoraproject.org
Wed Apr 24 15:26:11 UTC 2013


commit 92b8963a311b90d1bb6a83ba2c028a51a22132c0
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Wed Apr 24 11:21:48 2013 -0400

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

 efi-Check-EFI-revision-in-setup_efi_vars.patch |   35 ++++++++++++++++++++++++
 kernel.spec                                    |   11 +++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/efi-Check-EFI-revision-in-setup_efi_vars.patch b/efi-Check-EFI-revision-in-setup_efi_vars.patch
new file mode 100644
index 0000000..3e69cc6
--- /dev/null
+++ b/efi-Check-EFI-revision-in-setup_efi_vars.patch
@@ -0,0 +1,35 @@
+From 4b367720588ea97a32dc6393ac8975d6111ba72b Mon Sep 17 00:00:00 2001
+From: Josh Boyer <jwboyer at 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 at 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
+
diff --git a/kernel.spec b/kernel.spec
index 9271a03..7ea5d79 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -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
@@ -755,6 +755,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
@@ -1459,6 +1462,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
@@ -2292,6 +2298,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Wed Apr 24 2013 Josh Boyer <jwboyer at redhat.com>
+- Add patch to fix EFI boot on Macs (rhbz 953447)
+
 * Mon Apr 22 2013 Justin M. Forbes <jforbes at redhat.com> - 3.9.0-0.rc8.git0.1
 - Linux v3.9-rc8
 - Disable debugging options.


More information about the scm-commits mailing list