From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.bugs Subject: bug#19067: 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 Message-ID: <21608.36054.486023.532920@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1416138054 23929 80.91.229.3 (16 Nov 2014 11:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2014 11:40:54 +0000 (UTC) To: 19067@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 16 12:40:44 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpyCC-0007oJ-OX for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Nov 2014 12:40:44 +0100 Original-Received: from localhost ([::1]:43502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyCC-0000us-9f for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Nov 2014 06:40:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyBz-0000uf-Cn for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:40:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpyBd-0001d8-GR for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:40:31 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyBd-0001d3-DQ for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:40:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XpyBc-0005hJ-DX for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:40:09 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ulrich Mueller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Nov 2014 11:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141613797221804 (code B ref -1); Sun, 16 Nov 2014 11:40:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Nov 2014 11:39:32 +0000 Original-Received: from localhost ([127.0.0.1]:34363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpyB1-0005fc-O1 for submit@debbugs.gnu.org; Sun, 16 Nov 2014 06:39:31 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38114) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpyB0-0005fS-5K for submit@debbugs.gnu.org; Sun, 16 Nov 2014 06:39:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpyAq-0001Mj-2l for submit@debbugs.gnu.org; Sun, 16 Nov 2014 06:39:29 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyAq-0001Md-0P for submit@debbugs.gnu.org; Sun, 16 Nov 2014 06:39:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyAi-0000id-DM for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:39:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpyAa-0001L7-Uv for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:39:12 -0500 Original-Received: from a1www.kph.uni-mainz.de ([134.93.134.1]:54614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpyAa-0001Ku-LL for bug-gnu-emacs@gnu.org; Sun, 16 Nov 2014 06:39:04 -0500 Original-Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1www.kph.uni-mainz.de (8.14.9/8.14.7) with ESMTP id sAGBd2V6006139 for ; Sun, 16 Nov 2014 12:39:02 +0100 Original-Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.8/8.14.2) with ESMTP id sAGBd27C004282; Sun, 16 Nov 2014 12:39:02 +0100 Original-Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.8/8.14.8/Submit) id sAGBd2NF004278; Sun, 16 Nov 2014 12:39:02 +0100 X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96103 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.