preserve personality flag bits across exec
Subsystems (2)
PATCH 1/1 preserve personality flag bits across exec
Only x86, powerpc and sparc seem to preserve the upper bits of personality across exec(). Whether this is important depends on whether each architecture implements any bits in the upper 3 bytes of the personality. For ia64 the problem showed up when someone was trying to set ADDR_NO_RANDOMIZE and wanted the setting to stick across exec.
I'm planning on apply the patch below for ia64. Other arch maintainers should look to see if they need to do the same.
Signed-off-by Tony Luck <[email protected]>
---
arch/ia64/include/asm/elf.h +3 -1
@@ -201,7 +201,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);relevant until we have real hardware to play with... */ #define ELF_PLATFORM NULL -#define SET_PERSONALITY (ex) set_personality(PER_LINUX) +#define SET_PERSONALITY (ex) \ + set_personality((current->personality & ~PER_MASK) | PER_LINUX) +#define elf_read_implies_exec (ex, executable_stack) \ ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)