| Subject | Re: [PATCH 02/24] objtool: Add retpoline validation | From | David Woodhouse <> | Date | Fri, 26 Jan 2018 09:54:50 +0000 |
| |
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] |