Skip to content

Commit

Permalink
objtool: Fix function fallthrough detection for vmlinux
Browse files Browse the repository at this point in the history
Objtool's function fallthrough detection only works on C objects.
The distinction between C and assembly objects no longer makes sense
with objtool running on vmlinux.o.

Now that copy_user_64.S has been fixed up, and an objtool sibling call
detection bug has been fixed, the asm code is in "compliance" and this
hack is no longer needed.  Remove it.

Fixes: ed53a0d ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/b434cff98eca3a60dcc64c620d7d5d405a0f441c.1649718562.git.jpoimboe@redhat.com
  • Loading branch information
Josh Poimboeuf authored and Peter Zijlstra committed Apr 19, 2022
1 parent 34c861e commit 08feafe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
while (1) {
next_insn = next_insn_to_validate(file, insn);

if (file->c_file && func && insn->func && func != insn->func->pfunc) {
if (func && insn->func && func != insn->func->pfunc) {
WARN("%s() falls through to next function %s()",
func->name, insn->func->name);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion tools/objtool/include/objtool/objtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct objtool_file {
struct list_head static_call_list;
struct list_head mcount_loc_list;
struct list_head endbr_list;
bool ignore_unreachables, c_file, hints, rodata;
bool ignore_unreachables, hints, rodata;

unsigned int nr_endbr;
unsigned int nr_endbr_int;
Expand Down
1 change: 0 additions & 1 deletion tools/objtool/objtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ struct objtool_file *objtool_open_read(const char *_objname)
INIT_LIST_HEAD(&file.static_call_list);
INIT_LIST_HEAD(&file.mcount_loc_list);
INIT_LIST_HEAD(&file.endbr_list);
file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment");
file.ignore_unreachables = no_unreachable;
file.hints = false;

Expand Down

0 comments on commit 08feafe

Please sign in to comment.