projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b401efc
)
objtool: Make BP scratch register warning more robust
author
Josh Poimboeuf
<jpoimboe@redhat.com>
Wed, 1 Apr 2020 18:23:29 +0000
(13:23 -0500)
committer
Borislav Petkov
<bp@suse.de>
Tue, 14 Apr 2020 10:24:22 +0000
(12:24 +0200)
If func is NULL, a seg fault can result.
This is a theoretical issue which was found by Coverity, ID: 1492002
("Dereference after null check").
Fixes:
c705cecc8431
("objtool: Track original function across branches")
Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link:
https://lkml.kernel.org/r/afc628693a37acd287e843bcc5c0430263d93c74.1585761021.git.jpoimboe@redhat.com
tools/objtool/check.c
patch
|
blob
|
history
diff --git
a/tools/objtool/check.c
b/tools/objtool/check.c
index
cb2d299
..
4b170fd
100644
(file)
--- a/
tools/objtool/check.c
+++ b/
tools/objtool/check.c
@@
-2005,8
+2005,8
@@
static int validate_return(struct symbol *func, struct instruction *insn, struct
}
if (state->bp_scratch) {
- WARN
("%s uses BP
as a scratch register",
-
func->name
);
+ WARN
_FUNC("BP used
as a scratch register",
+
insn->sec, insn->offset
);
return 1;
}