[S390] personality: fix personality loss on execve
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 23 Jan 2009 15:40:23 +0000 (16:40 +0100)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 23 Jan 2009 15:40:28 +0000 (16:40 +0100)
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 <krebbel@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/include/asm/elf.h

index d480f39d65e647d74da4c5ae1f97c81c3e3c8e7b..74d0bbb7d955a53d863f97b6577c2ddf35d018fb 100644 (file)
@@ -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__ */