]> git.eshelyaron.com Git - emacs.git/commitdiff
Port to GNU/Linux with recent grsecurity/PaX patches (Bug#16343).
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Jan 2014 00:55:29 +0000 (16:55 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Jan 2014 00:55:29 +0000 (16:55 -0800)
Problem and proposed patch reported by Ulrich Mueller;
this patch uses a somewhat-different approach.
* configure.ac (SETFATTR): New variable.
* src/Makefile.in (SETFATTR): New macro.
(temacs$(EXEEXT)): Use it.

ChangeLog
configure.ac
src/ChangeLog
src/Makefile.in

index 24ff1b50abf397f93fd1459e4c2fe8877de6e46e..9cee33c45267a3fb22d0f091097bc199fa9a7a63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to GNU/Linux with recent grsecurity/PaX patches (Bug#16343).
+       Problem and proposed patch reported by Ulrich Mueller;
+       this patch uses a somewhat-different approach.
+       * configure.ac (SETFATTR): New variable.
+
 2014-01-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Merge from gnulib, incorporating:
index 6d46c5b67c5e75507cca609e0ff496a6ee671785..3822f4a8927ad48778f72cf0799d290fe6fd5d0d 100644 (file)
@@ -988,6 +988,24 @@ if test $opsys = gnu-linux; then
       [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then AC_MSG_RESULT(yes)
       else AC_MSG_RESULT(no); PAXCTL=""; fi])
   fi
+
+  if test "${SETFATTR+set}" != set; then
+    AC_CACHE_CHECK([for setfattr],
+      [emacs_cv_prog_setfattr],
+      [touch conftest.tmp
+       if (setfattr -n user.pax.flags conftest.tmp) >/dev/null 2>&1; then
+        emacs_cv_prog_setfattr=yes
+       else
+        emacs_cv_prog_setfattr=no
+       fi])
+    if test "$emacs_cv_prog_setfattr" = yes; then
+      SETFATTR=setfattr
+    else
+      SETFATTR=no
+    fi
+    rm -f conftest.tmp
+    AC_SUBST([SETFATTR])
+  fi
 fi
 
 ## Need makeinfo >= 4.7 (?) to build the manuals.
index 2c4c7921147e148c2b9c3380bd32b5e5847cf1a9..42f79d2ae469c3151a260e60c2b570d60a42c4af 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to GNU/Linux with recent grsecurity/PaX patches (Bug#16343).
+       * Makefile.in (SETFATTR): New macro.
+       (temacs$(EXEEXT)): Use it.
+
 2014-01-04  Martin Rudalics  <rudalics@gmx.at>
 
        Fix maximization behavior on Windows (Bug#16300).
index 78e555d873396e4e0e8dbe60b864cb036d49072d..00889e9a27716b46963a86b2f8925f474d038d1a 100644 (file)
@@ -108,11 +108,12 @@ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
 ## Flags to pass to ld only for temacs.
 TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
 
-## If available, the full path to the paxctl program.
+## If available, the names of the paxctl and setfattr programs.
 ## On grsecurity/PaX systems, unexec will fail due to a gap between
-## the bss section and the heap.  This can be prevented by disabling
-## memory randomization in temacs with "paxctl -r".  See bug#11398.
+## the bss section and the heap.  Older versions nee paxctl to work
+## around this, newer ones setfattr.  See Bug#11398 and Bug#16343.
 PAXCTL = @PAXCTL@
+SETFATTR = @SETFATTR@
 
 ## Some systems define this to request special libraries.
 LIBS_SYSTEM=@LIBS_SYSTEM@
@@ -494,6 +495,8 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
        $(TEMACS_POST_LINK)
        test "$(CANNOT_DUMP)" = "yes" || \
          test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
+       test "$(CANNOT_DUMP)" = "yes" || test -z "$(SETFATTR)" || \
+         $(SETFATTR) -n user.pax.flags -v r $@
 
 ## The following oldxmenu-related rules are only (possibly) used if
 ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.