[MODERATED] Re: LVI

Greg KH <[email protected]> Tue, 19 Nov 2019 19:46:26 +0100
Newsgroups org.kernel.lore.historical-speck
Message-ID <[email protected]>
On Tue, Nov 19, 2019 at 12:21:20PM -0600, speck for Josh Poimboeuf wrote:
> On Tue, Nov 19, 2019 at 07:12:57PM +0100, speck for Greg KH wrote:
> > > --- a/arch/x86/include/asm/uaccess.h
> > > +++ b/arch/x86/include/asm/uaccess.h
> > > @@ -119,9 +119,9 @@ extern int __get_user_bad(void);
> > >  
> > >  #define __uaccess_begin() stac()
> > >  #define __uaccess_end()   clac()
> > > -#define __uaccess_begin_nospec()	\
> > > +#define __uaccess_end_nospec()	\
> > >  ({					\
> > > -	stac();				\
> > > +	clac();				\
> > >  	barrier_nospec();		\
> > >  })
> > 
> > Um, don't we _really_ want stac() here?  That's the only thing that is
> > saving our butts in a number of places.  Why get rid of it?  Otherwise
> > it should be easy to cause a speculatave load by userspace for any
> > address they feel like.
> > 
> > Or am I mistaken about what you are trying to solve here?
> 
> Notice I renamed it to from __uaccess_begin_nospec() to
> __uaccess_end_nospec() ;-)
> 
> The idea is to move the LFENCE from _before_ the copy to _after_ the
> copy.  I didn't mess with stac/clac.

Ah, ick, sorry, totally mis-read that thing.  Nevermind...

greg k-h