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

Sami Tolvanen samitolvanen at google.com
Mon May 16 11:57:16 PDT 2022


On Sat, May 14, 2022 at 3:03 PM Kees Cook <keescook at chromium.org> wrote:
>
> On Fri, May 13, 2022 at 01:21:58PM -0700, Sami Tolvanen wrote:
> > +#ifdef CONFIG_CFI_CLANG
> > +static void decode_cfi_insn(struct pt_regs *regs, unsigned long *target,
> > +                         unsigned long *type)
> > +{
> > +     char buffer[MAX_INSN_SIZE];
> > +     struct insn insn;
> > +     int offset;
> > +
> > +     *target = *type = 0;
>
> Should report_cfi_failure() have some additional hinting for the case
> where target/type are zero? Like, "hey, got an inexplicable CFI failure
> here, but preamble decode failed. Yikes!"

Good point, I'll add an error message here.

Sami



More information about the linux-arm-kernel mailing list