lkml.org 
[lkml]   [2018]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/24] objtool: Add retpoline validation
From
Date
On Tue, 2018-01-23 at 16:25 +0100, Peter Zijlstra wrote:
>
> +               if (insn->type != INSN_JUMP_DYNAMIC &&
> +                   insn->type != INSN_CALL_DYNAMIC) {
> +                       WARN_FUNC("retpoline_safe hint not a indirect jump/call",
> +                                 insn->sec, insn->offset);
> +                       return -1;


...

        case 0xff:
                if (modrm_reg == 2 || modrm_reg == 3)

                        *type = INSN_CALL_DYNAMIC;

                else if (modrm_reg == 4)

                        *type = INSN_JUMP_DYNAMIC;

                else if (modrm_reg == 5)

                        /* jmpf */
                        *type = INSN_CONTEXT_SWITCH;


I *think* your check includes far calls (FF/3), although not far jumps?
It shouldn't, because I don't believe far calls are subject to the same
speculation?

Other than that, which you can probably ignore if you didn't have to
explicitly annotate [m]any safe far calls anyway,

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>

Thanks for doing this.[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2018-01-26 10:55    [W:0.285 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site