Re: [PATCH] objtool: Detect __nocfi calls

From: Miguel Ojeda
Date: Thu Apr 10 2025 - 15:33:50 EST


On Thu, Apr 10, 2025 at 5:46 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Detect and WARN about no_sanitize(kcfi) indirect calls.
>
> Apparently there were a few in some Rust 'core' that got included in the
> kernel and things went *bang*.
>
> This is not a supported form for kernel code. So detect and warn about
> it.

That was quick!

It seems to work -- I got:

LD vmlinux.o
vmlinux.o: warning: objtool:
_RNvNtCs8DPF7ip8WBQ_4core3fmt5write+0x170: no-cfi indirect call!

Cheers,
Miguel