public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Schoder <lists@gammarayburst.de>
To: discuss@x86-64.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Bring x86-64 ia32 emul in sync with i386 on READ_IMPLIES_EXEC enabling
Date: Sun, 2 Jul 2006 02:22:51 +0200	[thread overview]
Message-ID: <200607020222.51426.lists@gammarayburst.de> (raw)

Currently ia32 binaries behave differently with respect to enabling
READ_IMPLIES_EXEC. On i386 a binary with the exec_stack flag set is
executed with READ_IMPLIES_EXEC enabled as well. The same binary
executes without READ_IMPLIES_EXEC on x86-64.

This causes binaries that work on i386 to fail on x86-64 which goes
somewhat against the whole 32 bit emulation idea.

It has been argued that READ_IMPLIES_EXEC should not be enabled at all
for binaries that have the exec_stack flag. Which is probably a valid
point. However until this is clarified I think x86-64 should behave the
same for ia32 binaries as i386.

The following patch brings x86-64 in sync with i386 for ia32 binaries.

Signed-off-by: Markus Schoder <lists@gammarayburst.de>

-----

diff -u -r linux-2.6.17.3.old/arch/x86_64/ia32/ia32_binfmt.c linux-2.6.17.3/arch/x86_64/ia32/ia32_binfmt.c
--- linux-2.6.17.3.old/arch/x86_64/ia32/ia32_binfmt.c   2006-06-18 15:10:19.000000000 +0200
+++ linux-2.6.17.3/arch/x86_64/ia32/ia32_binfmt.c       2006-07-01 16:59:56.121915808 +0200
@@ -182,7 +182,7 @@
 #define user user32

 #define __ASM_X86_64_ELF_H 1
-#define elf_read_implies_exec(ex, have_pt_gnu_stack)   (!(have_pt_gnu_stack))
+#define elf_read_implies_exec(ex, executable_stack)     (executable_stack != EXSTACK_DISABLE_X)
 //#include <asm/ia32.h>
 #include <linux/elf.h>


             reply	other threads:[~2006-07-02  0:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-02  0:22 Markus Schoder [this message]
2006-07-04 11:24 ` [discuss] [PATCH] Bring x86-64 ia32 emul in sync with i386 on READ_IMPLIES_EXEC enabling Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200607020222.51426.lists@gammarayburst.de \
    --to=lists@gammarayburst.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox