From: Chris Wright <chrisw@sous-sol.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: hpa@linux.intel.com, mingo@elte.hu, tglx@linutronix.de,
linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [stable] [patch] x64: fix FPU corruption with signals and preemption
Date: Tue, 21 Apr 2009 22:49:51 +0000 [thread overview]
Message-ID: <20090421224951.GD24073@hera.kernel.org> (raw)
In-Reply-To: <1239315874.27006.8026.camel@localhost.localdomain>
* Suresh Siddha (suresh.b.siddha@intel.com) wrote:
> From: Suresh Siddha <suresh.b.siddha@intel.com>
> Subject: x64: fix FPU corruption with signals and preemption
>
> Impact: fix FPU state corruption
>
> In 64bit signal delivery path, clear_used_math() was happening before saving
> the current active FPU state on to the user stack for signal handling. Between
> clear_used_math() and the state store on to the user stack, potentially we
> can get a page fault for the user address and can block. Infact, while testing
> we were hitting the might_fault() in __clear_user() which can do a schedule().
>
> At a later point in time, we will schedule back into this process and
> resume the save state (using "xsave/fxsave" instruction) which can lead
> to DNA fault. And as used_math was cleared before, we will reinit the FP state
> in the DNA fault and continue. This reinit will result in loosing the
> FPU state of the process.
>
> Move clear_used_math() to a point after the FPU state has been stored
> onto the user stack.
>
> This issue is present from a long time (even before the xsave changes
> and the x86 merge). But it can easily be exposed in 2.6.28.x and 2.6.29.x
> series because of the __clear_user() in this path, which has an explicit
> __cond_resched() leading to a context switch with CONFIG_PREEMPT_VOLUNTARY.
>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
> Cc: stable@kernel.org [2.6.28.x, 2.6.29.x]
This one get lost?
thanks,
-chris
next prev parent reply other threads:[~2009-04-21 22:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 22:24 [patch] x64: fix FPU corruption with signals and preemption Suresh Siddha
2009-04-21 22:49 ` Chris Wright [this message]
2009-04-21 22:51 ` [stable] " H. Peter Anvin
2009-04-21 22:59 ` Chris Wright
2009-04-22 8:14 ` Ingo Molnar
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=20090421224951.GD24073@hera.kernel.org \
--to=chrisw@sous-sol.org \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=stable@kernel.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.