[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140605160842.GE16642@pd.tnic>
Date: Thu, 5 Jun 2014 18:08:42 +0200
From: Borislav Petkov <bp@...en8.de>
To: Andy Lutomirski <luto@...capital.net>
Cc: Matt Fleming <matt.fleming@...el.com>,
"H. Peter Anvin" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-tip-commits@...r.kernel.org"
<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:x86/efi] x86/efi: Check for unsafe dealing with FPU state
in irq ctxt
On Thu, Jun 05, 2014 at 09:01:02AM -0700, Andy Lutomirski wrote:
> NMI might be okay. I haven't checked.
Well, if efi decides to do FPU math and it happens in NMI, we will have
to provide for proper contexts handling.
> It has to change back, though. Completely unrealistic and useless example:
>
> int ctxt = what_context_im_in();
>
> set_up_the_fpu(ctxt);
>
> // kprobe fires and changes the context
> // kprobe does something
And since we're being completely unrealistic, kprobe decides to use the
fpu too and uses it...
> // kprobe changes the context back
>
> use the FPU. Life is good.
>
> put_back_the_fpu(ctxt);
So you probably need some way of mapping preallocated, per-cpu FPU
contexts to their users which can get and put them.
It's a whole different question whether that makes sense though, at all
or we simply remain conservative and don't do any efi in NMI context...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
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