This is a note to let you know that I've just added the patch titled objtool: Fix retpoline support for pre-ORC objtool to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: objtool-fix-retpoline-support-for-pre-orc-objtool.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From jpoimboe@xxxxxxxxxx Mon Jan 15 18:44:58 2018 From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Date: Mon, 15 Jan 2018 11:00:54 -0600 Subject: objtool: Fix retpoline support for pre-ORC objtool To: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Cc: gregkh@xxxxxxxxxxxxxxxxxxx, ak@xxxxxxxxxxxxxxx, dave.hansen@xxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxxx, jikos@xxxxxxxxxx, keescook@xxxxxxxxxx, luto@xxxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, pjt@xxxxxxxxxx, riel@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, tim.c.chen@xxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, stable-commits@xxxxxxxxxxxxxxx Message-ID: <20180115170054.6baepkgihtla4nub@treble> Content-Disposition: inline From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Objtool 1.0 (pre-ORC) produces the following warning when it encounters a retpoline: arch/x86/crypto/camellia-aesni-avx2-asm_64.o: warning: objtool: .altinstr_replacement+0xf: return instruction outside of a callable function That warning is meant to catch GCC bugs and missing ENTRY/ENDPROC annotations, neither of which are applicable to alternatives. Silence the warning for alternative instructions, just like objtool 2.0 already does. Reported-by: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/objtool/builtin-check.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -1230,6 +1230,14 @@ static int validate_uncallable_instructi for_each_insn(file, insn) { if (!insn->visited && insn->type == INSN_RETURN) { + + /* + * Don't warn about call instructions in unvisited + * retpoline alternatives. + */ + if (!strcmp(insn->sec->name, ".altinstr_replacement")) + continue; + WARN_FUNC("return instruction outside of a callable function", insn->sec, insn->offset); warnings++; Patches currently in stable-queue which might be from jpoimboe@xxxxxxxxxx are queue-4.9/x86-spectre-add-boot-time-option-to-select-spectre-v2-mitigation.patch queue-4.9/x86-retpoline-irq32-convert-assembler-indirect-jumps.patch queue-4.9/objtool-detect-jumps-to-retpoline-thunks.patch queue-4.9/x86-retpoline-hyperv-convert-assembler-indirect-jumps.patch queue-4.9/x86-retpoline-entry-convert-entry-assembler-indirect-jumps.patch queue-4.9/x86-asm-use-register-variable-to-get-stack-pointer-value.patch queue-4.9/x86-cpufeatures-add-x86_bug_cpu_insecure.patch queue-4.9/objtool-modules-discard-objtool-annotation-sections-for-modules.patch queue-4.9/x86-cpufeatures-make-cpu-bugs-sticky.patch queue-4.9/x86-retpoline-ftrace-convert-ftrace-assembler-indirect-jumps.patch queue-4.9/objtool-allow-alternatives-to-be-ignored.patch queue-4.9/x86-retpoline-crypto-convert-crypto-assembler-indirect-jumps.patch queue-4.9/selftests-x86-add-test_vsyscall.patch queue-4.9/x86-retpoline-xen-convert-xen-hypercall-indirect-jumps.patch queue-4.9/x86-cpu-merge-bugs.c-and-bugs_64.c.patch queue-4.9/x86-retpoline-checksum32-convert-assembler-indirect-jumps.patch queue-4.9/x86-retpoline-fill-return-stack-buffer-on-vmexit.patch queue-4.9/x86-retpoline-remove-compile-time-warning.patch queue-4.9/objtool-fix-retpoline-support-for-pre-orc-objtool.patch queue-4.9/x86-retpoline-add-initial-retpoline-support.patch