bpf: Reject flexible-array allocation types
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Reject flexible-array allocation typeskernel/ | +28 | 1 reply | |
| 2/2 | selftests/bpf: Cover flexible-array allocation rejectiontools/ tools/ | +25 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Eduard Zingerman |
|---|---|
| 1/2 | |
| 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 bpf-next 0/2] bpf: Reject flexible-array allocation types
bpf_obj_new() and bpf_percpu_obj_new() allocate only the static BTF size for the selected program-BTF type.
A program-BTF struct can nevertheless end with a zero-length flexible array. Generic BTF struct walks have special handling for such trailing arrays, and can validate field accesses beyond the allocated static object size.
Patch 1 rejects allocation kfunc types with trailing flexible arrays. Patch 2 adds a linked_list negative loader case for the rejection.
Yiyang Chen (2):
bpf: Reject flexible-array allocation types selftests/bpf: Cover flexible-array allocation rejection
kernel/bpf/verifier.c | 28 +++++++++++++++++++ .../selftests/bpf/prog_tests/linked_list.c | 2 ++ .../selftests/bpf/progs/linked_list_fail.c | 23 +++++++++++++++ 3 files changed, 53 insertions(+)
base-commit: a975094bf98ca97be9146f9d3b5681a6f9cf5ce3
Signature · 1 line
2.34.1