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

From: Dave Hansen
Date: Thu Sep 12 2024 - 13:45:53 EST


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.

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>