test_bpf.ko blinding fixes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpf/tests: Make max jump tests constant blinding compatiblelib/ | +1 | 0 replies | |
| 2/3 | bpf: Allow calling bpf_jit_blinding_enabled() with a NULL programinclude/ | +3 | 0 replies | |
| 3/3 | bpf/tests: Make staggered jump tests constant blinding compatiblekernel/ kernel/ lib/ | +23 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/3] test_bpf.ko blinding fixes
With BPF constant blinding enabled, various tests exercising jump offset limits currently fail because size assumptions in the code no longer apply. The created BPF program will be expanded through BPF constant blinding, pushing jump target offsets over the limit.
This small series fixes these by either avoiding the use of instructions with immediate values (patch 1) or accounting for the expansion (patch 3).
Before:
root@box:~# sysctl net.core.bpf_jit_harden=2 root@box:~# insmod test_bpf.ko insmod: ERROR: could not insert module test_bpf.ko: Invalid parameters root@box:~# dmesg | grep Summary [ 177.628099] test_bpf: Summary: 1000 PASSED, 49 FAILED, [988/988 JIT'ed]
After:
root@box:~# sysctl net.core.bpf_jit_harden=2 root@box:~# insmod test_bpf.ko root@box:~# dmesg | grep Summary [ 220.437597] test_bpf: Summary: 1049 PASSED, 0 FAILED, [1037/1037 JIT'ed] [ 220.477987] test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed] [ 220.480525] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED
Please apply!
Thanks,
Mathias
Mathias Krause (3):
bpf/tests: Make max jump tests constant blinding compatible
bpf: Allow calling bpf_jit_blinding_enabled() with a NULL program bpf/tests: Make staggered jump tests constant blinding compatible
include/linux/filter.h | 5 +++-- kernel/bpf/core.c | 3 +++ kernel/bpf/token.c | 3 +++ lib/test_bpf.c | 21 ++++++++++++++++++--- 4 files changed, 27 insertions(+), 5 deletions(-)
Signature · 1 line
2.30.2