Re: [PATCH] [RFC] cross-arch: don't corrupt personality flags uponexec()

From: Chris Metcalf
Date: Tue Aug 28 2012 - 12:53:00 EST


On 8/22/2012 3:27 PM, Arnd Bergmann wrote:
> On tile, the PER_LINUX_32BIT is always set for 32 bit compat tasks in a
> 64 bit kernel, which is harmless but wrong anyway. Also this, tile never
> calls set_personality, which is also harmless because it just means that
> exec_domain switching on tile is broken, but the only non-bogus
> exec_domain besides the default one is an experimental support for Acorn
> RISC OS binaries that was last updated in 2002 for for linux-2.5.49.

Arnd, thanks for the drive-by code review. Is this change the correct fix
for your observation?

diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h
index d16d006..fd31920 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_thread_info()->status &= ~TS_COMPAT; \
} while (0)
#define COMPAT_SET_PERSONALITY(ex) \
do { \
- current->personality = PER_LINUX_32BIT; \
+ set_personality(PER_LINUX); \
current_thread_info()->status |= TS_COMPAT; \
} while (0)

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/