summaryrefslogtreecommitdiffstats
path: root/tools/objtool
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2020-02-10 12:32:38 -0600
committerBorislav Petkov <bp@suse.de>2020-02-11 13:27:03 +0100
commit644592d328370af4b3e027b7b1ae9f81613782d8 (patch)
tree2dbf2792277d72d59912f8d51d134b1522d374ce /tools/objtool
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff)
downloadlinux-644592d328370af4b3e027b7b1ae9f81613782d8.tar.bz2
objtool: Fail the kernel build on fatal errors
When objtool encounters a fatal error, it usually means the binary is corrupt or otherwise broken in some way. Up until now, such errors were just treated as warnings which didn't fail the kernel build. However, objtool is now stable enough that if a fatal error is discovered, it most likely means something is seriously wrong and it should fail the kernel build. Note that this doesn't apply to "normal" objtool warnings; only fatal ones. Suggested-by: Borislav Petkov <bp@suse.de> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Julien Thierry <jthierry@redhat.com> Link: https://lkml.kernel.org/r/f18c3743de0fef673d49dd35760f26bdef7f6fc3.1581359535.git.jpoimboe@redhat.com
Diffstat (limited to 'tools/objtool')
-rw-r--r--tools/objtool/check.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4768d91c6d68..796f6a172efd 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2491,8 +2491,14 @@ int check(const char *_objname, bool orc)
out:
cleanup(&file);
- /* ignore warnings for now until we get all the code cleaned up */
- if (ret || warnings)
- return 0;
+ if (ret < 0) {
+ /*
+ * Fatal error. The binary is corrupt or otherwise broken in
+ * some way, or objtool itself is broken. Fail the kernel
+ * build.
+ */
+ return ret;
+ }
+
return 0;
}