[RFC PATCH 21/21] x86: Add support for CONFIG_CFI_CLANG

Sami Tolvanen samitolvanen at google.com
Mon May 2 08:20:05 PDT 2022


On Sat, Apr 30, 2022 at 2:24 AM Peter Zijlstra <peterz at infradead.org> wrote:
>
> On Fri, Apr 29, 2022 at 01:36:44PM -0700, Sami Tolvanen wrote:
> > -     if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
> > +     if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN ||
> > +         report_cfi(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
>
> This way you'll first get a BUG splat and then tack on the CFI thing.

The CFI ud2 isn't in the bug table, which means find_bug returns
BUG_TRAP_TYPE_NONE and report_bug bails out before printing out
anything.

Sami



More information about the linux-arm-kernel mailing list