Commit 5e143436 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

ARM: 6878/1: fix personality flag propagation across an exec

Our SET_PERSONALITY() implementation was overwriting all existing
personality flags, including ADDR_NO_RANDOMIZE, making them unavailable
to processes being exec'd after a call to personality() in user space.
This prevents the gdb test suite from running successfully.
Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent df5419a9
...@@ -40,15 +40,22 @@ EXPORT_SYMBOL(elf_check_arch); ...@@ -40,15 +40,22 @@ EXPORT_SYMBOL(elf_check_arch);
void elf_set_personality(const struct elf32_hdr *x) void elf_set_personality(const struct elf32_hdr *x)
{ {
unsigned int eflags = x->e_flags; unsigned int eflags = x->e_flags;
unsigned int personality = PER_LINUX_32BIT; unsigned int personality = current->personality & ~PER_MASK;
/*
* We only support Linux ELF executables, so always set the
* personality to LINUX.
*/
personality |= PER_LINUX;
/* /*
* APCS-26 is only valid for OABI executables * APCS-26 is only valid for OABI executables
*/ */
if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) { if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN &&
if (eflags & EF_ARM_APCS_26) (eflags & EF_ARM_APCS_26))
personality = PER_LINUX; personality &= ~ADDR_LIMIT_32BIT;
} else
personality |= ADDR_LIMIT_32BIT;
set_personality(personality); set_personality(personality);
......
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