Re: [PATCH v6 1/3] x86/entry_32: Do not clobber user EFLAGS.ZF

From: Pawan Gupta
Date: Fri Sep 13 2024 - 15:10:48 EST


On Thu, Sep 12, 2024 at 10:45:23AM -0700, Dave Hansen wrote:
> On 9/5/24 09:00, Pawan Gupta wrote:
> > Opportunistic SYSEXIT executes VERW to clear CPU buffers after user EFLAGS
> > are restored. This can clobber user EFLAGS.ZF.
> >
> > Move CLEAR_CPU_BUFFERS before the user EFLAGS are restored. This ensures
> > that the user EFLAGS.ZF is not clobbered.
>
> Just to be clear, the new (later) location is also safe for RFDS because
> it only exposes the contents of EFLAGS (not sensitive) and RAX.

Right.

> RAX might leak the old or new values of CR3, which do not seem super
> valuable to me.
>
> Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>

Thanks.