BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v8 0/2] Support kCFI + BPF on arm64
@ 2025-03-10 22:29 Sami Tolvanen
  2025-03-10 22:29 ` [PATCH bpf-next v8 1/2] cfi: add C CFI type macro Sami Tolvanen
  2025-03-10 22:29 ` [PATCH bpf-next v8 2/2] arm64/cfi,bpf: Support kCFI + BPF on arm64 Sami Tolvanen
  0 siblings, 2 replies; 7+ messages in thread
From: Sami Tolvanen @ 2025-03-10 22:29 UTC (permalink / raw)
  To: bpf
  Cc: Catalin Marinas, Will Deacon, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Mark Rutland, linux-arm-kernel, linux-kernel,
	Puranjay Mohan, Maxwell Bland, Sami Tolvanen

Hi folks,

These patches add KCFI types to arm64 BPF JIT output. Puranjay and
Maxwell have been working on this for some time now, but I haven't
seen any progress since June 2024, so I decided to pick up the latest
version[1] posted by Maxwell and fix the few remaining issues I
noticed. I confirmed that with these patches applied, I no longer see
CFI failures when running BPF self-tests on arm64.

[1] https://lore.kernel.org/linux-arm-kernel/ptrugmna4xb5o5lo4xislf4rlz7avdmd4pfho5fjwtjj7v422u@iqrwfrbwuxrq/

Sami

---

v8:
- Changed DEFINE_CFI_TYPE to use .4byte to match __CFI_TYPE.
- Changed cfi_get_func_hash() to again use get_kernel_nofault().
- Fixed a panic in bpf_jit_free() by resetting prog->bpf_func before
  calling bpf_jit_binary_pack_hdr().

---

Mark Rutland (1):
  cfi: add C CFI type macro

Puranjay Mohan (1):
  arm64/cfi,bpf: Support kCFI + BPF on arm64

 arch/arm64/include/asm/cfi.h    | 23 ++++++++++++++++++++++
 arch/arm64/kernel/alternative.c | 25 +++++++++++++++++++++++
 arch/arm64/net/bpf_jit_comp.c   | 22 ++++++++++++++++++---
 arch/riscv/kernel/cfi.c         | 35 +++------------------------------
 arch/x86/kernel/alternative.c   | 35 +++------------------------------
 include/linux/cfi_types.h       | 23 ++++++++++++++++++++++
 6 files changed, 96 insertions(+), 67 deletions(-)
 create mode 100644 arch/arm64/include/asm/cfi.h

-- 
2.49.0.rc0.332.g42c0ae87b1-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-17  9:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 22:29 [PATCH bpf-next v8 0/2] Support kCFI + BPF on arm64 Sami Tolvanen
2025-03-10 22:29 ` [PATCH bpf-next v8 1/2] cfi: add C CFI type macro Sami Tolvanen
2025-04-14  9:53   ` Dao Huang
2025-04-14 21:42     ` Sami Tolvanen
2025-04-17  9:07       ` Dao Huang
2025-03-10 22:29 ` [PATCH bpf-next v8 2/2] arm64/cfi,bpf: Support kCFI + BPF on arm64 Sami Tolvanen
2025-04-14  9:58   ` Dao Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox