mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Hans Rosenfeld <hans.rosenfeld@amd.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	tglx@linutronix.de, robert.richter@amd.com,
	andreas.herrmann3@amd.com
Subject: Re: [RFC] x86, fpu: unify signal handling code paths for x86 and x86_64 kernels
Date: Thu, 14 Jun 2012 18:07:15 -0700	[thread overview]
Message-ID: <1339722435.3475.57.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <4FDA7EDE.3070408@zytor.com>

On Thu, 2012-06-14 at 17:16 -0700, H. Peter Anvin wrote:
> On 06/14/2012 05:10 PM, Suresh Siddha wrote:
> > 
> > My personal preference is to use TIF_IA32 check and avoid  the usage of
> > is_ia32_task() in the signal delivery paths.
> 
> That is the quick fix, but...
> 
> > Signal return goes through a system call which already sets the
> > TS_COMPAT. It is the signal delivery that is causing the asymmetry.
> 
> Yes, and I think you missed some aspects of my statement: the notion
> would be that TS_COMPAT would be set from the TIF_IA32 flag at the time
> we decide to deliver a signal, the signal being a pseudo-system-call.
> However, the more I wonder about if that will confuse the crap out of
> ptrace, so using TIF_IA32 might just be the best thing anyway.
> 

Ok. Fix for the existing mainline code appended. Can you queue this
separately?
---
From: Suresh Siddha <suresh.b.siddha@intel.com>
Subject: x86, compat: use test_thread_flag(TIF_IA32) in compat signal delivery

Signal delivery compat path may not have the 'TS_COMPAT' flag set. So use
test_thread_flag(TIF_IA32) instead of is_ia32_task().

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: stable@kernel.org	# v3.4
---
 arch/x86/ia32/ia32_signal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index daeca56..673ac9b 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -38,7 +38,7 @@
 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
 {
 	int err = 0;
-	bool ia32 = is_ia32_task();
+	bool ia32 = test_thread_flag(TIF_IA32);
 
 	if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
 		return -EFAULT;



  reply	other threads:[~2012-06-15  1:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13  0:03 Suresh Siddha
2012-06-13  0:17 ` H. Peter Anvin
2012-06-14 14:37 ` Hans Rosenfeld
2012-06-14 20:45   ` Suresh Siddha
2012-06-15  0:10   ` Suresh Siddha
2012-06-15  0:16     ` H. Peter Anvin
2012-06-15  1:07       ` Suresh Siddha [this message]
2012-06-15  1:13         ` H. Peter Anvin
2012-06-15  1:16           ` Suresh Siddha
2012-06-15  1:17             ` H. Peter Anvin
2012-06-16  3:14         ` [tip:x86/urgent] x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery tip-bot for Suresh Siddha
2012-06-14 20:48 ` [RFC] x86, fpu: unify signal handling code paths for x86 and x86_64 kernels H. Peter Anvin
2012-06-14 20:49   ` Suresh Siddha

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=1339722435.3475.57.camel@sbsiddha-desk.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=hans.rosenfeld@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=robert.richter@amd.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®