Re: [RFC][PATCH 5/7] x86/speculation: Change __FILL_RETURN_BUFFER to work with objtool

From: Josh Poimboeuf
Date: Sun Apr 19 2020 - 12:55:30 EST


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.

--
Josh