Re: [PATCH] x86/entry: Read CR2 in asm entry stub to redcue NMI clobbering window

From: Rik van Riel

Date: Wed May 13 2026 - 12:57:19 EST


On Wed, 2026-05-13 at 09:31 -0700, Dave Hansen wrote:
> On 5/13/26 09:12, Rik van Riel wrote:
> > This reduces the NMI/RC2 race window by 90% -- from hundreds of C
> > instructions deep in the handler down to ~30 asm instructions in
> > error_entry.
>
> I'm all for using the FRED data. That's a no-brainer.
>
> But I'm not sure the assembly and plumbing is worth it just to
> _reduce_
> but not eliminate a race for non-FRED systems.
>
> What's the actual end-user-visible fallout from the race? Don't we
> just
> see the KASAN fault, skip it, IRET from the #PF and repeat the #PF?

That's a good question.

I have only "seen" this in syzkaller, so I don't know
what the symptoms would look like if a regular system
hit this race window.

I would not be surprised if we occasionally hit this
in production, but given that I don't know what the
symptoms would look like, I have no idea how often.


--
All Rights Reversed.