x86/retpoline: Swizzle retpoline thunk
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:15:35 +0000 (23:15 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Jun 2022 08:33:58 +0000 (10:33 +0200)
commit00e1533325fd1fb5459229fe37f235462649f668
tree43678bee2fa828a00e13aa4bc81f2ce5a2e91d25
parent369ae6ffc41a3c1137cab697635a84d0cc7cdcea
x86/retpoline: Swizzle retpoline thunk

Put the actual retpoline thunk as the original code so that it can
become more complicated. Specifically, it allows RET to be a JMP,
which can't be .altinstr_replacement since that doesn't do relocations
(except for the very first instruction).

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/lib/retpoline.S