bpf: permit bpf program narrower loads for ctx fields
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: permits narrower load from bpf program context fieldsinclude/ include/ kernel/ +3 more | +124 | 0 replies | |
| 2/2 | selftests/bpf: Add test cases to test narrower ctx field loadstools/ tools/ tools/ +1 more | +234 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Borkmann |
|---|---|
| 1/2 | A-b |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] bpf: permit bpf program narrower loads for ctx fields
Today, if users try to access a ctx field through a narrower load, e.g., __be16 prot = __sk_buff->protocol, verifier will fail.
This set contains the verifier change to permit such loads for certain ctx fields as well as the new test cases in selftests/bpf.
Yonghong Song (2):
bpf: permits narrower load from bpf program context fields selftests/bpf: Add test cases to test narrower ctx field loads
include/linux/bpf.h | 2 +- include/linux/bpf_verifier.h | 1 + kernel/bpf/verifier.c | 71 +++++--- kernel/trace/bpf_trace.c | 21 ++- net/core/filter.c | 56 +++++-- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/test_pkt_md_access.c | 35 ++++ tools/testing/selftests/bpf/test_progs.c | 21 +++ tools/testing/selftests/bpf/test_verifier.c | 200 ++++++++++++++++++----- 9 files changed, 324 insertions(+), 86 deletions(-) create mode 100644 tools/testing/selftests/bpf/test_pkt_md_access.c
Signature · 1 line
2.9.3