Skip to content

Commit

Permalink
objtool: Fix another switch table detection issue
Browse files Browse the repository at this point in the history
Continue the switch table detection whack-a-mole.  Add a check to
distinguish KASAN data reads from switch data reads.  The switch jump
tables in .rodata have relocations associated with them.

This fixes the following warning:

  crypto/asymmetric_keys/x509_cert_parser.o: warning: objtool: x509_note_pkey_algo()+0xa4: sibling call from callable instruction with modified stack frame

Reported-by: Arnd Bergmann <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Arnd Bergmann <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lkml.kernel.org/r/d7c8853022ad47d158cb81e953a40469fc08a95e.1519784382.git.jpoimboe@redhat.com
  • Loading branch information
jpoimboe authored and KAGA-KOKO committed Feb 28, 2018
1 parent 71c208d commit 1402fd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/objtool/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,11 @@ static struct rela *find_switch_table(struct objtool_file *file,
if (find_symbol_containing(file->rodata, text_rela->addend))
continue;

return find_rela_by_dest(file->rodata, text_rela->addend);
rodata_rela = find_rela_by_dest(file->rodata, text_rela->addend);
if (!rodata_rela)
continue;

return rodata_rela;
}

return NULL;
Expand Down

0 comments on commit 1402fd8

Please sign in to comment.