All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] objtool: Fix SLS checks
@ 2022-04-30 10:50 Peter Zijlstra
  2022-05-02 18:15 ` Josh Poimboeuf
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2022-04-30 10:50 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: x86, linux-kernel


Fix the SLS validation; not having a next instruction is also a fail
when the next instruction should be INSN_TRAP.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 tools/objtool/check.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 3f6785415894..3354101ffe34 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3380,7 +3380,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
 
 		case INSN_RETURN:
 			if (sls && !insn->retpoline_safe &&
-			    next_insn && next_insn->type != INSN_TRAP) {
+			    (!next_insn || (next_insn && next_insn->type != INSN_TRAP))) {
 				WARN_FUNC("missing int3 after ret",
 					  insn->sec, insn->offset);
 			}
@@ -3428,7 +3428,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
 
 		case INSN_JUMP_DYNAMIC:
 			if (sls && !insn->retpoline_safe &&
-			    next_insn && next_insn->type != INSN_TRAP) {
+			    (!next_insn || (next_insn && next_insn->type != INSN_TRAP))) {
 				WARN_FUNC("missing int3 after indirect jump",
 					  insn->sec, insn->offset);
 			}

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-05 21:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 10:50 [PATCH] objtool: Fix SLS checks Peter Zijlstra
2022-05-02 18:15 ` Josh Poimboeuf
2022-05-02 20:01   ` Peter Zijlstra
2022-05-02 20:09     ` Josh Poimboeuf
2022-05-02 20:17   ` Peter Zijlstra
2022-05-03 21:15     ` Josh Poimboeuf
2022-05-04  7:26       ` Peter Zijlstra
2022-05-05 21:03         ` Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.