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

Sami Tolvanen
2022-05-16T18:57:58Z

On Sat, May 14, 2022 at 3:03 PM Kees Cook <keescook@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