Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Always fail on fatal errors

Objtool writes several object annotations which are used to enable
critical kernel runtime functionalities like static calls and
retpoline/rethunk patching.

In the rare case where it fails to read or write an object, the
annotations don't get written, causing runtime code patching to fail and
code to become corrupted.

Due to the catastrophic nature of such warnings, convert them to errors
which fail the build regardless of CONFIG_OBJTOOL_WERROR.

Reported-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/7d35684ca61eac56eb2424f300ca43c5d257b170.1743481539.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/SJ1PR11MB61295789E25C2F5197EFF2F6B9A72@SJ1PR11MB6129.namprd11.prod.outlook.com

authored by

Josh Poimboeuf and committed by
Ingo Molnar
0b101771 c5610071

+4 -11
+4 -11
tools/objtool/check.c
··· 4753 4753 if (!ret && !warnings) 4754 4754 return 0; 4755 4755 4756 + if (opts.werror && warnings) 4757 + ret = 1; 4758 + 4756 4759 if (opts.verbose) { 4757 4760 if (opts.werror && warnings) 4758 4761 WARN("%d warning(s) upgraded to errors", warnings); ··· 4763 4760 disas_warned_funcs(file); 4764 4761 } 4765 4762 4766 - /* 4767 - * CONFIG_OBJTOOL_WERROR upgrades all warnings (and errors) to actual 4768 - * errors. 4769 - * 4770 - * Note that even fatal errors don't yet actually return an error 4771 - * without CONFIG_OBJTOOL_WERROR. That will be fixed soon-ish. 4772 - */ 4773 - if (opts.werror) 4774 - return 1; 4775 - 4776 - return 0; 4763 + return ret; 4777 4764 }