[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdmptEpi8fiOyWUo=AiZJiX+Z+VHJOM2buLPrWsMTwLnyw@mail.gmail.com>
Date: Tue, 15 Sep 2020 15:34:39 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>,
Marco Elver <elver@...gle.com>
Cc: Borislav Petkov <bp@...en8.de>, Rong Chen <rong.a.chen@...el.com>,
kernel test robot <lkp@...el.com>,
"Li, Philip" <philip.li@...el.com>, x86-ml <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
kasan-dev <kasan-dev@...glegroups.com>
Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e
On Tue, Sep 15, 2020 at 2:02 PM Josh Poimboeuf <jpoimboe@...hat.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
Powered by blists - more mailing lists