Re: [RFC][PATCH 5/7] x86/speculation: Change __FILL_RETURN_BUFFER to work with objtool
From: Peter Zijlstra
Date: Sun Apr 19 2020 - 14:59:17 EST
On Sun, Apr 19, 2020 at 11:55:19AM -0500, Josh Poimboeuf wrote:
> On Sun, Apr 19, 2020 at 11:52:00AM -0500, Josh Poimboeuf wrote:
> > Are we still planning to warn about stack changes inside an alternative?
> > If so then this would still fail...
> >
> > In this case I think it should be safe, but I'm not sure how we can
> > ensure that will always be the case for other alternatives.
> >
> > And do the ORC entries actually work for this? As far as I can tell,
> > they would be associated with the .altinstructions section and not
> > .text, so it wouldn't work.
>
> My preference would be to move RSB stuffing out-of-line too, like you
> did the retpolines. Or use static branches. Then we could add an
> objtool warning to prevent stack changes in alternatives.
I effectively did the static_branch thing, but with an alternative, it's
in the last patch, due to me being a moron and not refreshing the stack
before sending it out.