[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211028213058.GQ174703@worktop.programming.kicks-ass.net>
Date: Thu, 28 Oct 2021 23:30:58 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andrew Cooper <andrew.cooper3@...rix.com>
Cc: x86@...nel.org, Josh Poimboeuf <jpoimboe@...hat.com>,
keescook@...omium.org, linux-kernel@...r.kernel.org,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will@...nel.org>, hjl.tools@...il.com
Subject: Re: [RFC][PATCH] x86: Add straight-line-speculation mitigation
On Thu, Oct 28, 2021 at 09:06:30PM +0100, Andrew Cooper wrote:
> It would be remiss of me not to say... In Xen, I've currently gone with:
>
> #ifdef CONFIG_SPECULATIVE_HARDEN_STRAIGHT_LINE
> # define ret ret; int3
> # define retq retq; int3
#define retq ret
Surely :-)
> #endif
>
>
> which avoids needing to patch any asm files, and therefore is a far less
> invasive patch.
All the asm stuff was more or less:
find arch/x86/ -name \*.s | while read file;
do
sed -i $file -e 's/\<retq?\>/RET/'
done
or thereabout. The pesky bits were the inline asm and realizing that
RETPOLINE_SAFE also means we really don't care about SLS.
> I know those defines probably deserve a WTF, and will confuse anyone who
> doesn't understand the phrase "painting blue", but they have the
> advantage that casual contributions don't need to remember to avoid
> naked `ret` instructions to maintain safety, making it a rather more
> robust option.
objtool while whinge if someone forgets
Powered by blists - more mailing lists