Skip to content

x86/cfi,bpf: Fix CFI vs eBPF

Peter Zijlstra bpf linux-arch linux-riscv lkml llvm netdev 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 1 replyApplied 7/7
  2. v22 patches 32 repliesSuperseded
  3. v12 patches 11 repliesSuperseded

Patches in v3 All 7 applied

#Subject and filesSizeRepliesApplied
1/7cfi: Flip headersarch/riscv/include/asm/cfi.h arch/riscv/kernel/cfi.c arch/x86/include/asm/cfi.h +4 more+14 -50 repliesApplied
2/7x86/cfi,bpf: Fix BPF JIT callarch/x86/include/asm/cfi.h arch/x86/kernel/alternative.c arch/x86/net/bpf_jit_comp.c +3 more+269 -140 repliesApplied
3/7x86/cfi,bpf: Fix bpf_callback_t CFIarch/x86/include/asm/cfi.h arch/x86/kernel/alternative.c arch/x86/net/bpf_jit_comp.c+30 -80 repliesApplied
4/7x86/cfi,bpf: Fix bpf_struct_ops CFIarch/x86/include/asm/cfi.h arch/x86/kernel/alternative.c arch/x86/net/bpf_jit_comp.c +4 more+191 -320 repliesApplied
5/7cfi: Add CFI_NOSEAL()arch/x86/include/asm/cfi.h include/linux/cfi.h+9 -00 repliesApplied
6/7bpf: Fix dtor CFIkernel/bpf/cpumask.c kernel/bpf/helpers.c net/bpf/test_run.c+34 -50 repliesApplied
7/7x86/cfi,bpf: Fix bpf_exception_cb() signatureinclude/linux/bpf.h kernel/bpf/helpers.c+2 -20 repliesApplied

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchSami Tolvanen
1/7R-b
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] x86/cfi,bpf: Fix CFI vs eBPF

Hi!

What started with the simple observation that bpf_dispatcher_*_func() was broken for calling CFI functions with a __nocfi calling context for FineIBT ended up with a complete BPF wide CFI fixup.

With these changes on the BPF selftest suite passes without crashing -- there's still a few failures, but Alexei has graciously offered to look into those.

(Alexei, I have presumed your SoB on the very last patch, please update as you see fit)

Changes since v2 are numerous but include:
- cfi_get_offset() -- as a means to communicate the offset (ast)
- 5 new patches fixing various BPF internals to be CFI clean

Note: it *might* be possible to merge the bpf_bpf_tcp_ca.c:unsupported_ops[] thing into the CFI stubs, as is get_info will have a NULL stub, unlike the others.

---
 arch/riscv/include/asm/cfi.h   |   3 +-
 arch/riscv/kernel/cfi.c        |   2 +-
 arch/x86/include/asm/cfi.h     | 126 +++++++++++++++++++++++++++++++++++++-
 arch/x86/kernel/alternative.c  |  87 +++++++++++++++++++++++---
 arch/x86/kernel/cfi.c          |   4 +-
 arch/x86/net/bpf_jit_comp.c    | 134 +++++++++++++++++++++++++++++++++++------
 include/asm-generic/Kbuild     |   1 +
 include/linux/bpf.h            |  27 ++++++++-
 include/linux/cfi.h            |  12 ++++
 kernel/bpf/bpf_struct_ops.c    |  16 ++---
 kernel/bpf/core.c              |  25 ++++++++
 kernel/bpf/cpumask.c           |   8 ++-
 kernel/bpf/helpers.c           |  18 +++++-
 net/bpf/bpf_dummy_struct_ops.c |  31 +++++++++-
 net/bpf/test_run.c             |  15 ++++-
 net/ipv4/bpf_tcp_ca.c          |  69 +++++++++++++++++++++
 16 files changed, 528 insertions(+), 50 deletions(-)

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv