From: Andy Whitcroft <apw@canonical.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Christoph Hellwig <hch@lst.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Andy Whitcroft <apw@canonical.com>
Subject: [PATCH 1/1] x86: ensure we correctly advertise 32 bit processes in a 64 bit kernel
Date: Tue, 14 Sep 2010 17:00:57 +0100 [thread overview]
Message-ID: <1284480057-18120-2-git-send-email-apw@canonical.com> (raw)
In-Reply-To: <1284480057-18120-1-git-send-email-apw@canonical.com>
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@canonical.com>
---
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
next prev parent reply other threads:[~2010-09-14 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 16:00 [PATCH 0/1] x86: should 32 bit processes be PER_LINUX32 Andy Whitcroft
2010-09-14 16:00 ` Andy Whitcroft [this message]
2010-09-14 18:19 ` H. Peter Anvin
2010-09-14 18:31 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1284480057-18120-2-git-send-email-apw@canonical.com \
--to=apw@canonical.com \
--cc=hch@lst.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome