RFC bpf: kernel CO-RE relocation
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btf: copy relo_core from tools to kernelkernel/ kernel/ kernel/ | +1396 | 0 replies | |
| 2/2 | btf: adapt relo_core for kernel compilationinclude/ kernel/ kernel/ | +289 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC bpf 0/2] bpf: kernel CO-RE relocation
From: Matteo Croce <[email protected]>
This series is a preliminary work to move the CO-RE relocations in the kernel. This is the first step to have signed BPF files, since userspace instruction patching makes any verification ineffective.
The first patch just copies the relocation code from tools/lib/bpf/, the second one refactors the whole code so to build it in kernel. It builds with a single warning, which can be suppressed by switching to dynamic allocation:
kernel/bpf/relo_core.c: In function 'bpf_core_apply_relo_insn':
kernel/bpf/relo_core.c:1457:1: warning: the frame size of 2776 bytes is larger than 1024 bytes [-Wframe-larger-than=]
To really use this code and do the the relocations done in kernel, we will need an API to pass the relocation informations along the BPF file, so don't consider this patches for inclusion, but just as a first step toward the full work.
Matteo Croce (2):
btf: copy relo_core from tools to kernel
btf: adapt relo_core for kernel compilation
include/linux/btf.h | 65 ++ kernel/bpf/Makefile | 1 + kernel/bpf/btf.c | 45 +- kernel/bpf/relo_core.c | 1457 ++++++++++++++++++++++++++++++++++++++++ kernel/bpf/relo_core.h | 100 +++ 5 files changed, 1630 insertions(+), 38 deletions(-) create mode 100644 kernel/bpf/relo_core.c create mode 100644 kernel/bpf/relo_core.h
Signature · 1 line
2.31.1