lkml.org 
[lkml]   [2022]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] objtool: Fix SLS checks

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);
}
\
 
 \ /
  Last update: 2022-04-30 12:51    [W:0.128 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site