grub2/grub2-fix-x86_64-efi-startup-stack-alignment.patch
Stephan Kulow d6309f618c Accepting request 207913 from Base:System
- add grub2-fix-x86_64-efi-startup-stack-alignment.patch and
  grub2-fix-x86_64-efi-callwrap-stack-alignment.patch: fix the
  stack alignment of x86_64 efi. (bnc#841426) (forwarded request 207910 from gary_lin)

OBS-URL: https://build.opensuse.org/request/show/207913
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=75
2013-11-22 16:39:40 +00:00

34 lines
1.1 KiB
Diff

From 7960d3e1823bd3ea569109dcfe269447c3589fac Mon Sep 17 00:00:00 2001
From: Josh Triplett <josh@joshtriplett.org>
Date: Tue, 19 Nov 2013 14:31:40 +0100
Subject: * grub-core/kern/x86_64/efi/startup.S (_start): Align the
stack to a 16-byte boundary, as required by the x86-64 ABI, before calling
grub_main. In some cases, GCC emits code that assumes this alignment, which
crashes if not aligned. The EFI firmware is also entitled to assume that
stack alignment without checking.
References: bnc#841426
Patch-Mainline: yes
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
---
grub-core/kern/x86_64/efi/startup.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/kern/x86_64/efi/startup.S b/grub-core/kern/x86_64/efi/startup.S
index f86f019..9357e5c 100644
--- a/grub-core/kern/x86_64/efi/startup.S
+++ b/grub-core/kern/x86_64/efi/startup.S
@@ -30,6 +30,6 @@ _start:
movq %rcx, EXT_C(grub_efi_image_handle)(%rip)
movq %rdx, EXT_C(grub_efi_system_table)(%rip)
+ andq $~0xf, %rsp
call EXT_C(grub_main)
- ret
-
+ /* Doesn't return. */
--
1.8.1.4