Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Fix segfault in ignore_unreachable_insn()

Check 'prev_insn' before dereferencing it.

Fixes: bd841d6154f5 ("objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/5df4ff89c9e4b9e788b77b0531234ffa7ba03e9e.1743136205.git.jpoimboe@kernel.org

Closes: https://lore.kernel.org/d86b4cc6-0b97-4095-8793-a7384410b8ab@app.fastmail.com
Closes: https://lore.kernel.org/Z-V_rruKY0-36pqA@gmail.com

authored by

Josh Poimboeuf and committed by
Ingo Molnar
69d41d6d d9a595c3

+1 -1
+1 -1
tools/objtool/check.c
··· 4037 4037 * It may also insert a UD2 after calling a __noreturn function. 4038 4038 */ 4039 4039 prev_insn = prev_insn_same_sec(file, insn); 4040 - if (prev_insn->dead_end && 4040 + if (prev_insn && prev_insn->dead_end && 4041 4041 (insn->type == INSN_BUG || 4042 4042 (insn->type == INSN_JUMP_UNCONDITIONAL && 4043 4043 insn->jump_dest && insn->jump_dest->type == INSN_BUG)))