lkml.org 
[lkml]   [2023]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] x86/retpoline: Don't clobber RFLAGS during srso_safe_ret()
From
On Fri, Aug 11, 2023, Mika Penttilä wrote:
> > @@ -252,11 +252,10 @@ SYM_START(srso_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
> > .byte 0x48, 0xb8
> > SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL)
> > - add $8, %_ASM_SP
> > + lea 8(%_ASM_SP), %_ASM_SP
> > ret
> > int3
> > int3
> > - int3
> > lfence
> > call srso_safe_ret
> > int3
> >
> > base-commit: 25aa0bebba72b318e71fe205bfd1236550cc9534
>
> Don't we have the same kind of problems with __x86_return_skl ?

Yep, forcing that path via "retbleed=force retbleed=stuff spectre_v2=retpoline,generic"
yields the same failures. I have no idea how to go about cleanly fixing that.
The logic effectively requires modifying flags, the only thing I can think of is
to save/restore flags across the thunk, which seems beyond gross.

Given that no one has complained about this, I think I'd vote to simply disable
KVM if call depth tracking is being used.

\
 
 \ /
  Last update: 2023-08-12 04:58    [W:0.250 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site