Re: [PATCH bpf-next 0/1] Support kCFI + BPF on arm64

From: Alexei Starovoitov
Date: Mon Mar 11 2024 - 21:26:35 EST


On Tue, Feb 27, 2024 at 7:11 AM Puranjay Mohan <puranjay12@xxxxxxxxx> wrote:
>
> On ARM64 with CONFIG_CFI_CLANG, CFI warnings can be triggered by running
> the bpf selftests. This is because the JIT doesn't emit proper CFI prologues
> for BPF programs, callbacks, and struct_ops trampolines.
>
> Example Warning:
>
> CFI failure at bpf_rbtree_add_impl+0x120/0x1d4 (target: bpf_prog_fb8b097ab47d164a_less+0x0/0x98; expected type: 0x9e4709a9)
> WARNING: CPU: 0 PID: 1488 at bpf_rbtree_add_impl+0x120/0x1d4

..

> Running the selftests causes no CFI warnings:
> ---------------------------------------------
>
> test_progs: Summary: 454/3613 PASSED, 62 SKIPPED, 74 FAILED
> test_tag: OK (40945 tests)
> test_verifier: Summary: 789 PASSED, 0 SKIPPED, 0 FAILED

Catalin, Mark,

Could you please review and hopefully ack arm64 generic bits ?

The JIT changes largely mimic x86 changes and look correct to me.