emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108471: Workaround dumping proble


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108471: Workaround dumping problem on PaX-enabled Linux kernels
Date: Fri, 02 Nov 2012 01:46:00 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108471
fixes bug: http://debbugs.gnu.org/11398
author: Ulrich Müller <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sun 2012-06-03 16:14:22 -0700
message:
  Workaround dumping problem on PaX-enabled Linux kernels
  
  * configure.in (PAXCTL): Check for paxctl.
  
  * src/Makefile.in (PAXCTL): Define.
  (temacs$(EXEEXT)): Disable memory randomization for the temacs
  binary via PaX flags if the paxctl utility is available.
  (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
  Restore PaX flags to their default.
modified:
  ChangeLog
  configure.in
  src/ChangeLog
  src/Makefile.in
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-06-01 18:26:21 +0000
+++ b/ChangeLog 2012-06-03 23:14:22 +0000
@@ -1,3 +1,7 @@
+2012-06-03  Ulrich Müller  <address@hidden>
+
+       * configure.in (PAXCTL): Check for paxctl. (Bug#11398)
+
 2012-06-01  Paul Eggert  <address@hidden>
 
        Remove --disable-maintainer-mode option from 'configure'.  (Bug#11555)

=== modified file 'configure.in'
--- a/configure.in      2012-06-01 18:26:21 +0000
+++ b/configure.in      2012-06-03 23:14:22 +0000
@@ -699,6 +699,8 @@
   $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
 dnl Don't use GZIP, which is used by gzip for additional parameters.
 AC_PATH_PROG(GZIP_PROG, gzip)
+AC_PATH_PROG(PAXCTL, paxctl,,
+  [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
 
 
 ## Need makeinfo >= 4.7 (?) to build the manuals.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-06-03 10:23:49 +0000
+++ b/src/ChangeLog     2012-06-03 23:14:22 +0000
@@ -1,3 +1,11 @@
+2012-06-03  Ulrich Müller  <address@hidden>
+
+       * Makefile.in (PAXCTL): Define.
+       (temacs$(EXEEXT)): Disable memory randomization for the temacs
+       binary via PaX flags if the paxctl utility is available.
+       (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
+       Restore PaX flags to their default.  (Bug#11398)
+
 2012-06-03  Chong Yidong  <address@hidden>
 
        * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte

=== modified file 'src/Makefile.in'
--- a/src/Makefile.in   2012-05-22 16:20:27 +0000
+++ b/src/Makefile.in   2012-06-03 23:14:22 +0000
@@ -113,6 +113,12 @@
 ## $LDFLAGS or empty if NS_IMPL_GNUSTEP (for some reason).
 TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
 
+## If available, the full path to the paxctl program.
+## 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.
+PAXCTL = @PAXCTL@
+
 ## Some systems define this to request special libraries.
 address@hidden@
 
@@ -403,6 +409,7 @@
            -f list-load-path-shadows || true; \
        else \
          LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
+         test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
          ln -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
          ./emacs -batch -f list-load-path-shadows || true; \
        fi
@@ -450,6 +457,8 @@
 temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) 
$(lib)/libgnu.a
        $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) 
$(TEMACS_LDFLAGS2) \
          -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
+       test "$(CANNOT_DUMP)" = "yes" || \
+         test "X$(PAXCTL)" = X || $(PAXCTL) -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
@@ -597,6 +606,7 @@
          ln -f temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
        else \
          $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
+         test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
          mv -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
        fi
        @: Compile some files earlier to speed up further compilation.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]