All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: ebmunson@us.ibm.com, benh@kernel.crashing.org, paulus@samba.org,
	mm-commits@vger.kernel.org
Subject: - powerpc-keep-3-high-personality-bytes-across-exec.patch removed from -mm tree
Date: Wed, 02 Jul 2008 00:47:11 -0700	[thread overview]
Message-ID: <200807020747.m627lB1f005630@imap1.linux-foundation.org> (raw)


The patch titled
     powerpc: keep 3 high personality bytes across exec
has been removed from the -mm tree.  Its filename was
     powerpc-keep-3-high-personality-bytes-across-exec.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: powerpc: keep 3 high personality bytes across exec
From: Eric B Munson <ebmunson@us.ibm.com>

Currently when a 32 bit process is exec'd on a powerpc 64 bit host the
value in the top three bytes of the personality is clobbered.  This patch
adds a check in the SET_PERSONALITY macro that will carry all the values
in the top three bytes across the exec.

These three bytes currently carry flags to disable address randomisation,
limit the address space, force zeroing of an mmapped page, etc.  Should an
application set any of these bits they will be maintained and honoured on
homogeneous environment but discarded and ignored on a heterogeneous
environment.  So if an application requires all mmapped pages to be
initial= ised to zero and a wrapper is used to setup the personality and
exec the target, these flags will remain set on an all 32 or all 64 bit
envrionment, but they will be lost in the exec on a mixed 32/64 bit
environment.  Losing these bi= ts means that the same application would
behave differently in different environments.  Tested on a POWER5+ machine
with 64bit kernel and a mixed 64/32 bit user space.

Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/asm-powerpc/elf.h   |    3 ++-
 include/linux/personality.h |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff -puN include/asm-powerpc/elf.h~powerpc-keep-3-high-personality-bytes-across-exec include/asm-powerpc/elf.h
--- a/include/asm-powerpc/elf.h~powerpc-keep-3-high-personality-bytes-across-exec
+++ a/include/asm-powerpc/elf.h
@@ -257,7 +257,8 @@ do {								\
 	else							\
 		clear_thread_flag(TIF_ABI_PENDING);		\
 	if (personality(current->personality) != PER_LINUX32)	\
-		set_personality(PER_LINUX);			\
+		set_personality(PER_LINUX |			\
+			(current->personality & PER_INHERIT));	\
 } while (0)
 /*
  * An executable for which elf_read_implies_exec() returns TRUE will
diff -puN include/linux/personality.h~powerpc-keep-3-high-personality-bytes-across-exec include/linux/personality.h
--- a/include/linux/personality.h~powerpc-keep-3-high-personality-bytes-across-exec
+++ a/include/linux/personality.h
@@ -36,6 +36,12 @@ enum {
 	ADDR_LIMIT_3GB = 	0x8000000,
 };
 
+/* Mask for the above personality values */
+#define PER_INHERIT (ADDR_NO_RANDOMIZE|FDPIC_FUNCPTRS|MMAP_PAGE_ZERO| \
+			ADDR_COMPAT_LAYOUT|READ_IMPLIES_EXEC|ADDR_LIMIT_32BIT| \
+			SHORT_INODE|WHOLE_SECONDS|STICKY_TIMEOUTS| \
+			ADDR_LIMIT_3GB)
+
 /*
  * Security-relevant compatibility flags that must be
  * cleared upon setuid or setgid exec:
_

Patches currently in -mm which might be from ebmunson@us.ibm.com are

linux-next.patch


                 reply	other threads:[~2008-07-02  7:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200807020747.m627lB1f005630@imap1.linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=ebmunson@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.