bpf: bound rdonly/rdwr_buf_size kfunc return size
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Changes in v2 from the cover letter
* Split the fix and selftest into separate patches.
* Target bpf-next instead of bpf.
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: reject rdonly/rdwr_buf_size kfunc arguments that exceed u32 maxkernel/ | +5 | 4 replies | Applied |
| 2/2 | selftests/bpf: add test for oversized rdonly/rdwr_buf_size kfunc argumenttools/ tools/ | +34 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Eduard Zingerman |
|---|---|
| 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-next v2 0/2] bpf: bound rdonly/rdwr_buf_size kfunc return size
check_kfunc_args() stores a kfunc's rdonly_buf_size/rdwr_buf_size argument into a u64 that check_kfunc_call() later narrows into the returned register's u32 mem_size, so a value above U32_MAX truncates instead of being rejected. Fix it and add a selftest for coverage.
Changelog:
----------
v1 -> v2 (v1 was a private report to [email protected])
* Split the fix and selftest into separate patches.
* Target bpf-next instead of bpf.
Nicholas Dudar (2):
bpf: reject rdonly/rdwr_buf_size kfunc arguments that exceed u32 max selftests/bpf: add test for oversized rdonly/rdwr_buf_size kfunc
argument
kernel/bpf/verifier.c | 5 +++ .../selftests/bpf/prog_tests/kfunc_call.c | 1 + .../selftests/bpf/progs/kfunc_call_fail.c | 33 +++++++++++++++++++ 3 files changed, 39 insertions(+)
base-commit: 36ffa86c42f91c8a57071e024afc4ffb51a8958f
Signature · 1 line
2.34.1