From: Heiko Carstens Date: Fri, 23 Jan 2009 15:40:23 +0000 (+0100) Subject: [S390] personality: fix personality loss on execve X-Git-Tag: MMI-PSA29.97-13-9~29760^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03e4c49f847f23c62900424f65a62f76de5a7151;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [S390] personality: fix personality loss on execve Use the personality() macro to mask out all bits that are not relevant for the personality type. The personality field contains bits for other things as well, so without masking out the not relevalent bits the comparison won't do what is expected. Reported-by: Andreas Krebbel Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index d480f39d65e6..74d0bbb7d955 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h @@ -172,14 +172,14 @@ extern char elf_platform[]; #ifndef __s390x__ #define SET_PERSONALITY(ex) set_personality(PER_LINUX) #else /* __s390x__ */ -#define SET_PERSONALITY(ex) \ -do { \ - if (current->personality != PER_LINUX32) \ - set_personality(PER_LINUX); \ - if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ - set_thread_flag(TIF_31BIT); \ - else \ - clear_thread_flag(TIF_31BIT); \ +#define SET_PERSONALITY(ex) \ +do { \ + if (personality(current->personality) != PER_LINUX32) \ + set_personality(PER_LINUX); \ + if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ + set_thread_flag(TIF_31BIT); \ + else \ + clear_thread_flag(TIF_31BIT); \ } while (0) #endif /* __s390x__ */