[PATCH v6 10/11] ARM: hw_breakpoint: Handle CFI breakpoints

Sami Tolvanen samitolvanen at google.com
Fri Apr 19 14:25:13 PDT 2024


On Fri, Apr 19, 2024 at 5:56 AM Linus Walleij <linus.walleij at linaro.org> wrote:
>
> On Thu, Apr 18, 2024 at 6:13 PM Sami Tolvanen <samitolvanen at google.com> wrote:
>
> > > +       switch (report_cfi_failure(regs, instruction_pointer(regs), &target, type)) {
> >
> > Nit: To make the error message a bit cleaner, you can use
> > report_cfi_failure_noaddr(...) instead,
>
> OK, fixed it!
>
> > and maybe you can expand the
> > comment to explain why target information isn't trivially available
> > right now?
>
> Sure, but I guess I would need you to explain it to me so I don't get
> it wrong :D
>
> Is it correct to say:
>
> "TODO: To be able to properly extract target information the compiler
> needs to be extended with operand bundling lowering into the 32-bit
> ARM targets, and currently no compiler has implemented this."
>
> ?

I think operand bundles are specific to the LLVM implementation, so
they're probably not worth mentioning. I would just mention that the
reason we can't trivially figure out the target address and the
expected type hash when handling KCFI traps on 32-bit ARM is that the
current compilers don't generate a stable instruction sequence for
KCFI checks that would allow us to decode the instructions preceding
the trap and look up which registers were used.

Sami



More information about the linux-arm-kernel mailing list