[PATCH 1/1] x86: ensure we correctly advertise 32 bit processes in a 64 bit kernel

From: Andy Whitcroft
Date: Tue Sep 14 2010 - 12:01:33 EST


A number of generic system calls modify their behaviour for 32 bit
processes when executed on a 64 bit kernel. For example the uname
family return i686 for 32 bit processes but x86_64 for 64 bit processes.
These calls determine which return to use based on the personality,
specifically they check for PER_LINUX32. x86 does not currently set this
personality type, using an x86 specific thread bit to distinguish.

Ensure we use personality PER_LINUX32 for 32 bit processes.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxxx>
---
arch/x86/kernel/process_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 3d9ea53..3793a6a 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -518,7 +518,7 @@ void set_personality_ia32(void)

/* Make sure to be in 32bit mode */
set_thread_flag(TIF_IA32);
- current->personality |= force_personality32;
+ current->personality |= force_personality32 | PER_LINUX32;

/* Prepare the first "return" to user space */
current_thread_info()->status |= TS_COMPAT;
--
1.7.0.4

--
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/