[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080726143756.GK4401@elte.hu>
Date: Sat, 26 Jul 2008 16:37:56 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
"x86@...nel.org" <x86@...nel.org>,
"andi@...stfloor.org" <andi@...stfloor.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"stable@...nel.org" <stable@...nel.org>
Subject: Re: [patch] x64, fpu: fix possible FPU leakage in error conditions
* Suresh Siddha <suresh.b.siddha@...el.com> wrote:
> On Thu, Jul 24, 2008 at 03:43:44PM -0700, Linus Torvalds wrote:
> > So how about this patch as a starting point? This is the RightThing(tm) to
> > do regardless, and if it then makes it easier to do some other cleanups,
> > we should do it first. What do you think?
>
> Linus, Attached is my last attempt for the day. Please review. Thanks.
> ---
>
> restore_fpu_checking() calls init_fpu() in error conditions. While
> this is wrong(as our main intention is to clear the fpu state of the
> thread), this was benign before the commit
> 92d140e21f1ce8cf99320afbbcad73879128e6dc.
>
> Post commit 92d140e21f1ce8cf99320afbbcad73879128e6dc, live FPU
> registers may not belong to this process at this error scenario.
>
> In the error condition for restore_fpu_checking() (especially during
> the 64bit signal return), we are doing init_fpu(), which saves the
> live FPU register state (possibly belonging to some other process
> context) into the thread struct (through unlazy_fpu() in init_fpu()).
> This is wrong and can leak the FPU data.
>
> For the signal handler restore error condition in restore_i387(),
> clear the fpu state present in the thread struct(before ultimately
> sending a SIGSEGV for badframe).
>
> For the paranoid error condition check in math_state_restore(), send a
> SIGSEGV, if we fail to restore the state.
i've applied your patch to tip/x86/fpu for further testing. I suspect
once it proves reliable we can merge it into v2.6.27, after -rc1.
Ingo
--
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