GNU bug report logs - #19067
24.4; temacs startup failure when both PT_PAX and XATTR_PAX flags are enabled in Linux

Previous Next

Package: emacs;

Reported by: Ulrich Mueller <ulm <at> gentoo.org>

Date: Sun, 16 Nov 2014 11:40:03 UTC

Severity: important

Tags: fixed, patch

Found in version 24.4

Fixed in version 24.5

Done: Ulrich Mueller <ulm <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19067 in the body.
You can then email your comments to 19067 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19067; Package emacs. (Sun, 16 Nov 2014 11:40:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Mueller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 16 Nov 2014 11:40:09 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; temacs startup failure when both PT_PAX and XATTR_PAX
 flags are enabled in Linux
Date: Sun, 16 Nov 2014 12:39:02 +0100
Forwarding Gentoo bug reports https://bugs.gentoo.org/497498 and
https://bugs.gentoo.org/526948 :

On a GNU/Linux system with grsecurity/PaX enabled Linux kernel,
temacs startup will fail when both CONFIG_PAX_PT_PAX_FLAGS and
CONFIG_PAX_XATTR_PAX_FLAGS are enabled:

   if test "no" = "yes"; then \
     rm -f bootstrap-emacs; \
     ln temacs bootstrap-emacs; \
   else \
     ./temacs --batch --load loadup bootstrap || exit 1; \
     test "X/sbin/paxctl" = X || /sbin/paxctl -zex emacs; \
     mv -f emacs bootstrap-emacs; \
   fi
   /bin/sh: line 7:  1591 Killed                  ./temacs --batch --load
   loadup bootstrap
   Makefile:815: recipe for target 'bootstrap-emacs' failed
   make[1]: *** [bootstrap-emacs] Error 1
   make[1]: Leaving directory
   '/var/tmp/portage/app-editors/emacs-24.4/work/emacs-24.4/src'
   Makefile:382: recipe for target 'src' failed
   make: *** [src] Error 2

The problem is that paxctl(1) sets the "e" flag ("do not emulate
trampolines") by default for ELF binaries, but setfattr(1) doesn't.
While in principle both settings of the flag would be OK for our case,
Linux (the kernel) refuses to run the binary if the PT_PAX and
XATTR_PAX flags are inconsistent with one another.

Adding the "e" flag also to setfattr fixes this. Patch will follow.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19067; Package emacs. (Sun, 16 Nov 2014 11:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 19067 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Müller <ulm <at> gentoo.org>
To: 19067 <at> debbugs.gnu.org
Subject: [PATCH] Use consistent paxctl and setfattr flags for temacs.
Date: Sun, 16 Nov 2014 12:49:09 +0100
From 7a519d08281d003f26bb4a9048dd5d428fb7f21e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm <at> gentoo.org>
Date: Sun, 16 Nov 2014 12:37:54 +0100
Subject: [PATCH] Use consistent paxctl and setfattr flags for temacs.

* Makefile.in (temacs$(EXEEXT)): Use consistent flag settings
for paxctl and setfattr. Fixes temacs startup failure with
grsecurity/PaX enabled Linux kernel (bug#19067).
---
 src/ChangeLog   | 6 ++++++
 src/Makefile.in | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index f9f3a0f..7c690e2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-16  Ulrich Müller  <ulm <at> gentoo.org>
+
+	* Makefile.in (temacs$(EXEEXT)): Use consistent flag settings
+	for paxctl and setfattr. Fixes temacs startup failure with
+	grsecurity/PaX enabled Linux kernel (bug#19067).
+
 2014-11-16  Stefan Monnier  <monnier <at> iro.umontreal.ca>
 
 	* frame.c (Fhandle_switch_frame): Deactivate shift-region (bug#19003).
diff --git a/src/Makefile.in b/src/Makefile.in
index 70e31b5..99f9981 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -497,7 +497,7 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
 	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 $@
+	  $(SETFATTR) -n user.pax.flags -v er $@
 
 ## The following oldxmenu-related rules are only (possibly) used if
 ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
-- 
2.1.3





Added tag(s) patch. Request was from Ulrich Mueller <ulm <at> gentoo.org> to control <at> debbugs.gnu.org. (Sun, 16 Nov 2014 11:51:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19067; Package emacs. (Sun, 23 Nov 2014 11:47:04 GMT) Full text and rfc822 format available.

Message #13 received at 19067 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: 19067 <at> debbugs.gnu.org
Subject: Re: [PATCH] Use consistent paxctl and setfattr flags for temacs.
Date: Sun, 23 Nov 2014 12:46:33 +0100
Any objections against this patch? Otherwise, I would push it to the
emacs-24 branch. 




Added tag(s) fixed. Request was from Ulrich Mueller <ulm <at> gentoo.org> to control <at> debbugs.gnu.org. (Tue, 25 Nov 2014 06:57:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.5, send any further explanations to 19067 <at> debbugs.gnu.org and Ulrich Mueller <ulm <at> gentoo.org> Request was from Ulrich Mueller <ulm <at> gentoo.org> to control <at> debbugs.gnu.org. (Tue, 25 Nov 2014 06:57:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Dec 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.