[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALmL7E_5Tn7s5Bd03nRiec8LkmMfpyMOh_Rp8BHK2BjitzHc4A@mail.gmail.com>
Date: Mon, 1 Sep 2014 22:01:46 -0700
From: Suresh Siddha <sbsiddha@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Bean Anderson <bean@...lsystems.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"the arch/x86 maintainers" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86, fpu: __restore_xstate_sig()->math_state_restore()
needs preempt_disable()
On Mon, Aug 25, 2014 at 11:08 AM, Oleg Nesterov <oleg@...hat.com> wrote:
>
> Add preempt_disable() + preempt_enable() around math_state_restore() in
> __restore_xstate_sig(). Otherwise __switch_to() after __thread_fpu_begin()
> can overwrite fpu->state we are going to restore.
>
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> Cc: stable@...r.kernel.org
> ---
> arch/x86/kernel/xsave.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
> index 453343c..c52eb9c 100644
> --- a/arch/x86/kernel/xsave.c
> +++ b/arch/x86/kernel/xsave.c
> @@ -397,8 +397,11 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
> set_used_math();
> }
>
> - if (use_eager_fpu())
> + if (use_eager_fpu()) {
> + preempt_disable();
> math_state_restore();
> + preempt_enable();
> + }
>
> return err;
> } else {
>
oops. looks good to me.
Reviewed-by: Suresh Siddha <sbsiddha@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists