Fix narrow loads from an offset outside of target field
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 3 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Load zeros for narrow loads beyond target fieldkernel/ | +21 | 2 replies | |
| 2/2 | selftests/bpf: Add test for narrow loads from context at an offsettools/ tools/ | +127 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Yonghong Song |
|---|---|
| 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 bpf v2 0/2] Fix narrow loads from an offset outside of target field
This is a second attempt at fixing narrow loads from context fields backed by smaller-in-size target fields, when load offset is beyond the target field.
Following Yonghong suggestion, verifier now emits an 'wX = 0' or 'rX = 0' instruction for loads from offsets outside of target field.
Cc Yonghong Song <[email protected]>
[v1] https://lore.kernel.org/bpf/[email protected]/
Jakub Sitnicki (2):
bpf: Load zeros for narrow loads beyond target field selftests/bpf: Add test for narrow loads from context at an offset
kernel/bpf/verifier.c | 23 ++++- .../selftests/bpf/prog_tests/narrow_load.c | 84 +++++++++++++++++++ .../selftests/bpf/progs/test_narrow_load.c | 43 ++++++++++ 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/narrow_load.c create mode 100644 tools/testing/selftests/bpf/progs/test_narrow_load.c
Signature · 1 line
2.25.4