Thread (6 messages) 6 messages, 4 authors, 2020-09-08

Re: [GIT PULL] livepatching for 5.9-rc5

From: Josh Poimboeuf <hidden>
Date: 2020-09-08 20:59:58
Also in: lkml
Subsystem: objtool, the rest · Maintainers: Josh Poimboeuf, Peter Zijlstra, Linus Torvalds

On Tue, Sep 08, 2020 at 11:42:00AM -0700, Linus Torvalds wrote:
On Tue, Sep 8, 2020 at 11:32 AM Josh Poimboeuf [off-list ref] wrote:
quoted
Can you share the .o file?  At least I can't recreate with GCC 9.3.1,
which is all I have at the moment.
Done off-list in private, because I don't think anybody else wants
object files flying around on the mailing lists..
The problem is that objtool ignores handle_external_interrupt_irqoff()
(because it has the STACK_FRAME_NON_STANDARD annotation), and the
'ignore' logic is a bit crude.

Because that function is ignored, the tail call isn't detected (as you
pointed out).  Which confuses the static noreturn detection logic.

The proper fix would be to move that thunk call code to proper asm,
where we can add some unwind hints, and then get rid of the
STACK_FRAME_NON_STANDARD.

But, in the interest of being lazy, here's the easiest fix for now.
I'll need to run some builds to make sure it doesn't break anything.
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e034a8f24f46..90a66891441a 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -619,7 +619,7 @@ static int add_jump_destinations(struct objtool_file *file)
 		if (!is_static_jump(insn))
 			continue;
 
-		if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET)
+		if (insn->offset == FAKE_JUMP_OFFSET)
 			continue;
 
 		reloc = find_reloc_by_dest_range(file->elf, insn->sec,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help