From: Josh Poimboeuf Date: Tue, 8 Apr 2025 07:02:15 +0000 (-0700) Subject: objtool: Stop UNRET validation on UD2 X-Git-Tag: v6.1.136~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aebc6708c38da9bae90f6c7c2bec2357468c7cc;p=thirdparty%2Fkernel%2Fstable.git objtool: Stop UNRET validation on UD2 [ Upstream commit 9f9cc012c2cbac4833746a0182e06a8eec940d19 ] In preparation for simplifying INSN_SYSCALL, make validate_unret() terminate control flow on UD2 just like validate_branch() already does. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Linus Torvalds Link: https://lore.kernel.org/r/ce841269e7e28c8b7f32064464a9821034d724ff.1744095216.git.jpoimboe@kernel.org Signed-off-by: Sasha Levin --- diff --git a/tools/objtool/check.c b/tools/objtool/check.c index b6c91bb5ce3e3..828c91aaf55bd 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3737,6 +3737,9 @@ static int validate_entry(struct objtool_file *file, struct instruction *insn) break; } + if (insn->dead_end) + return 0; + if (!next) { WARN_FUNC("teh end!", insn->sec, insn->offset); return -1;