aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2013-12-31 00:14:24 +0100
committerUlrich Müller <ulm@gentoo.org>2013-12-31 00:14:24 +0100
commit88a257278a1a85b82884b84d634f73f65c40b9c2 (patch)
tree392e39a2e34a7f740edc719c9fe4fda7a8c9de31
parentAdd missing ChangeLog entries. (diff)
downloademacs-patches-88a257278a1a85b82884b84d634f73f65c40b9c2.tar.gz
emacs-patches-88a257278a1a85b82884b84d634f73f65c40b9c2.tar.bz2
emacs-patches-88a257278a1a85b82884b84d634f73f65c40b9c2.zip
Fix failure in unexec with hardened kernel, bug 456970.emacs-24.3-patches-4emacs-23.4-patches-9
-rw-r--r--emacs/23.4/15_all_pax-xattr.patch45
-rw-r--r--emacs/24.3/04_all_pax-xattr.patch45
2 files changed, 90 insertions, 0 deletions
diff --git a/emacs/23.4/15_all_pax-xattr.patch b/emacs/23.4/15_all_pax-xattr.patch
new file mode 100644
index 0000000..53d97c3
--- /dev/null
+++ b/emacs/23.4/15_all_pax-xattr.patch
@@ -0,0 +1,45 @@
+Fix failure in unexec with hardened Linux kernel and XATTR_PAX_FLAGS=y.
+https://bugs.gentoo.org/456970
+
+--- emacs-23.4-orig/configure.in
++++ emacs-23.4/configure.in
+@@ -812,6 +812,18 @@
+ fi
+ fi
+
++AC_PATH_PROG(SETFATTR, setfattr)
++if test "X$SETFATTR" != X; then
++ AC_MSG_CHECKING([whether extended attributes are supported])
++ touch conftest.tmp
++ if $SETFATTR -n user.pax.flags conftest.tmp >/dev/null 2>&1; then
++ AC_MSG_RESULT(yes)
++ else
++ AC_MSG_RESULT(no); SETFATTR=""
++ fi
++ rm -f conftest.tmp
++fi
++
+ ## Need makeinfo >= 4.6 (?) to build the manuals.
+ AC_PATH_PROG(MAKEINFO, makeinfo, no)
+ dnl By this stage, configure has already checked for egrep and set EGREP,
+--- emacs-23.4-orig/src/Makefile.in
++++ emacs-23.4/src/Makefile.in
+@@ -514,6 +514,9 @@
+ memory randomization in temacs with "paxctl -r". See bug#11398. */
+ PAXCTL = @PAXCTL@
+
++/* If available, the full path to the setfattr program. */
++SETFATTR = @SETFATTR@
++
+ /* A macro which other sections of Makefile can redefine to munge the
+ flags before they are passed to LD. This is helpful if you have
+ redefined LD to something odd, like "gcc".
+@@ -983,6 +986,8 @@
+ #endif
+ #ifndef CANNOT_DUMP
+ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
++ test "X$(SETFATTR)" = X \
++ || $(SETFATTR) -n user.pax.flags -v r temacs$(EXEEXT)
+ #endif
+
+ /* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
diff --git a/emacs/24.3/04_all_pax-xattr.patch b/emacs/24.3/04_all_pax-xattr.patch
new file mode 100644
index 0000000..90346ba
--- /dev/null
+++ b/emacs/24.3/04_all_pax-xattr.patch
@@ -0,0 +1,45 @@
+Fix failure in unexec with hardened Linux kernel and XATTR_PAX_FLAGS=y.
+https://bugs.gentoo.org/456970
+
+--- emacs-24.3-orig/configure.ac
++++ emacs-24.3/configure.ac
+@@ -790,6 +790,18 @@
+ fi
+ fi
+
++AC_PATH_PROG(SETFATTR, setfattr)
++if test "X$SETFATTR" != X; then
++ AC_MSG_CHECKING([whether extended attributes are supported])
++ touch conftest.tmp
++ if $SETFATTR -n user.pax.flags conftest.tmp >/dev/null 2>&1; then
++ AC_MSG_RESULT(yes)
++ else
++ AC_MSG_RESULT(no); SETFATTR=""
++ fi
++ rm -f conftest.tmp
++fi
++
+ ## Need makeinfo >= 4.7 (?) to build the manuals.
+ AC_PATH_PROG(MAKEINFO, makeinfo, no)
+ dnl By this stage, configure has already checked for egrep and set EGREP,
+--- emacs-24.3-orig/src/Makefile.in
++++ emacs-24.3/src/Makefile.in
+@@ -115,6 +115,9 @@
+ ## memory randomization in temacs with "paxctl -r". See bug#11398.
+ PAXCTL = @PAXCTL@
+
++## If available, the full path to the setfattr program.
++SETFATTR = @SETFATTR@
++
+ ## Some systems define this to request special libraries.
+ LIBS_SYSTEM=@LIBS_SYSTEM@
+
+@@ -467,6 +470,8 @@
+ -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
+ test "$(CANNOT_DUMP)" = "yes" || \
+ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
++ test "$(CANNOT_DUMP)" = "yes" || test "X$(SETFATTR)" = X || \
++ $(SETFATTR) -n user.pax.flags -v r temacs$(EXEEXT)
+
+ ## The following oldxmenu-related rules are only (possibly) used if
+ ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them