]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
objtool: Stop UNRET validation on UD2
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 8 Apr 2025 07:02:15 +0000 (00:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:37 +0000 (07:44 +0200)
[ 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 <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/ce841269e7e28c8b7f32064464a9821034d724ff.1744095216.git.jpoimboe@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/objtool/check.c

index c2596b1e1fb1e30562e19c9c9c07c6b2452a064b..d2366ec61edc4c464f508d2858970426120a5a38 100644 (file)
@@ -3416,6 +3416,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;