Re: [v8,02/12] objtool: Allow alternatives to be ignored

From: David Woodhouse
Date: Mon Jan 22 2018 - 14:34:41 EST


On Thu, 2018-01-18 at 11:41 -0800, Guenter Roeck wrote:
>
> > Not sure, does your gcc have retpolines? Give me your .o file and I can
> > diagnose it.
>
> Yes, it does, only it is the gcc from the Google toolchain which may
> generate different code than the upstream version.
>
> I attached an affected object file. Please let me know if there is anything else
> I can do to help.
Disassembly of section .text.__x86.indirect_thunk:

0000000000000000 <__x86.indirect_thunk>:
ÂÂÂ0: e8 04 00 00 00ÂÂÂÂÂÂÂ callqÂÂ9 <__x86.indirect_thunk+0x9>
ÂÂÂ5: f3 90ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ pauseÂÂ
ÂÂÂ7: eb fcÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ jmpÂÂÂÂ5 <__x86.indirect_thunk+0x5>
ÂÂÂ9: 48 8d 64 24 08ÂÂÂÂÂÂÂ leaÂÂÂÂ0x8(%rsp),%rsp
ÂÂÂe: c3ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ retqÂÂÂ

That has the old-style CET-incompatible retpoline in a COMDAT section
in the .o file. What compiler options are being used for that? The
kernel should only use retpoline if GCC supports both of
-mindirect-branch=thunk-extern and -mindirect-branch-register, and this
compiler is doing *neither* of those.Â

Attachment: smime.p7s
Description: S/MIME cryptographic signature