aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-10-04 17:12:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-06 03:04:47 +0900
commit9f6547a3209b78689ab8183630df87ca5e13fec0 (patch)
tree99aa4f2cc9eab61f8d013ab379834b607b942026 /arch
parentcross-arch: don't corrupt personality flags upon exec() (diff)
downloadlinux-dev-9f6547a3209b78689ab8183630df87ca5e13fec0.tar.xz
linux-dev-9f6547a3209b78689ab8183630df87ca5e13fec0.zip
tile: fix personality bits handling upon exec()
Historically, the top three bytes of personality have been used for things such as ADDR_NO_RANDOMIZE, which made sense only for specific architectures. We now however have a flag there that is general no matter the architecture (UNAME26); generally we have to be careful to preserve the personality flags across exec(). This patch fixes tile architecture not to forcefully overwrite personality flags during exec(). In addition to that, we fix two other things along the way: - exec_domain switching is fixed -- set_personality() should always be used instead of directly assigning to current->personality. - as pointed out by Arnd Bergmann, PER_LINUX_32BIT is not used anywhere by tile, so let's just drop that in favor of PER_LINUX Signed-off-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/tile/include/asm/elf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h
index d16d006d660e..f8ccf08f6934 100644
--- a/arch/tile/include/asm/elf.h
+++ b/arch/tile/include/asm/elf.h
@@ -156,12 +156,12 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
#undef SET_PERSONALITY
#define SET_PERSONALITY(ex) \
do { \
- current->personality = PER_LINUX; \
+ set_personality(PER_LINUX | (current->personality & (~PER_MASK))); \
current_thread_info()->status &= ~TS_COMPAT; \
} while (0)
#define COMPAT_SET_PERSONALITY(ex) \
do { \
- current->personality = PER_LINUX_32BIT; \
+ set_personality(PER_LINUX | (current->personality & (~PER_MASK))); \
current_thread_info()->status |= TS_COMPAT; \
} while (0)