a3bfe35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a3bfe35
From: Peter Jones <pjones@redhat.com>
a3bfe35
Date: Fri, 28 Sep 2018 15:48:09 -0400
a3bfe35
Subject: [PATCH] Do not allow stack trampolines, anywhere.
a3bfe35
a3bfe35
Signed-off-by: Peter Jones <pjones@redhat.com>
a3bfe35
---
a3bfe35
 configure.ac         | 3 +++
a3bfe35
 conf/Makefile.common | 2 +-
a3bfe35
 2 files changed, 4 insertions(+), 1 deletion(-)
a3bfe35
a3bfe35
diff --git a/configure.ac b/configure.ac
a3bfe35
index 40fcf567ae7..077df917593 100644
a3bfe35
--- a/configure.ac
a3bfe35
+++ b/configure.ac
a3bfe35
@@ -1983,6 +1983,9 @@ if test x"$enable_wextra" != xno ; then
a3bfe35
   HOST_CFLAGS="$HOST_CFLAGS -Wextra"
a3bfe35
 fi
a3bfe35
 
a3bfe35
+TARGET_CFLAGS="$TARGET_CFLAGS -Werror=trampolines -fno-trampolines"
a3bfe35
+HOST_CFLAGS="$HOST_CFLAGS -Werror=trampolines -fno-trampolines"
a3bfe35
+
a3bfe35
 TARGET_CPP="$TARGET_CC -E"
a3bfe35
 TARGET_CCAS=$TARGET_CC
a3bfe35
 
a3bfe35
diff --git a/conf/Makefile.common b/conf/Makefile.common
a3bfe35
index 0d9910d7875..38375a7891c 100644
a3bfe35
--- a/conf/Makefile.common
a3bfe35
+++ b/conf/Makefile.common
a3bfe35
@@ -66,7 +66,7 @@ grubconfdir = $(sysconfdir)/grub.d
a3bfe35
 platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
a3bfe35
 starfielddir = $(pkgdatadir)/themes/starfield
a3bfe35
 
a3bfe35
-CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code
a3bfe35
+CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Werror=trampolines -fno-trampolines
a3bfe35
 CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
a3bfe35
 
a3bfe35
 CFLAGS_POSIX = -fno-builtin