Commit a91a03ee authored by Eric B Munson's avatar Eric B Munson Committed by Paul Mackerras

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: default avatarEric B Munson <ebmunson@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 89b5810f
...@@ -255,7 +255,8 @@ do { \ ...@@ -255,7 +255,8 @@ do { \
else \ else \
clear_thread_flag(TIF_ABI_PENDING); \ clear_thread_flag(TIF_ABI_PENDING); \
if (personality(current->personality) != PER_LINUX32) \ if (personality(current->personality) != PER_LINUX32) \
set_personality(PER_LINUX); \ set_personality(PER_LINUX | \
(current->personality & (~PER_MASK))); \
} while (0) } while (0)
/* /*
* An executable for which elf_read_implies_exec() returns TRUE will * An executable for which elf_read_implies_exec() returns TRUE will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment