aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2008-06-30 12:12:13 -0400
committerPaul Mackerras <paulus@samba.org>2008-07-01 00:47:02 -0400
commita91a03ee31a5c29a934708b7cf37bb8da516d016 (patch)
treebb2c25456759a865a64ae5326846301e7962802b
parent89b5810f6ed4b2d42415e5ec656ab6b148cd2bde (diff)
powerpc: Keep 3 high personality bytes across exec
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. 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 initialised 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 bits 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> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--include/asm-powerpc/elf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index 746e53d60cbe..b6a874db801d 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -255,7 +255,8 @@ do { \
255 else \ 255 else \
256 clear_thread_flag(TIF_ABI_PENDING); \ 256 clear_thread_flag(TIF_ABI_PENDING); \
257 if (personality(current->personality) != PER_LINUX32) \ 257 if (personality(current->personality) != PER_LINUX32) \
258 set_personality(PER_LINUX); \ 258 set_personality(PER_LINUX | \
259 (current->personality & (~PER_MASK))); \
259} while (0) 260} while (0)
260/* 261/*
261 * An executable for which elf_read_implies_exec() returns TRUE will 262 * An executable for which elf_read_implies_exec() returns TRUE will