lkml.org 
[lkml]   [2020]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e
On Tue, Sep 15, 2020 at 2:02 PM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> panic() is noreturn, so the compiler is enforcing the fact that it
> doesn't return, by trapping if it does return.
>
> I seem to remember that's caused by CONFIG_UBSAN_TRAP.

Indeed, if I remove CONFIG_UBSAN_TRAP from the 0day report's
randconfig, these unreachable instruction warnings all go away.

So what's the right way to fix this?

CONFIG_UBSAN_TRAP enables -fsanitize-undefined-trap-on-error (not
sure why that's wrapped in cc-option; it shouldn't be selectable via
Kconfig if unsupported by the toolchain).

Should clang not be emitting `ud2` trapping instructions for this flag
for no-return functions?

or

Should objtool be made aware of the config option and then not check
traps after no-returns?

I suspect the latter, but I'm not sure how feasible it is to
implement. Josh, Marco, do you have thoughts on the above?
--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2020-09-16 00:40    [W:0.345 / U:8.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site