Skip to content

Dynptr refactorings

Kumar Kartikeya Dwivedi bpf 2 versions – Applied

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 · linked by author and title

  1. v2 Latest7 patches 1 replyApplied 7/7
  2. v17 patches 20 repliesSuperseded

Changes in v2 from the cover letter

v1: https://lore.kernel.org/bpf/[email protected]

* Address feedback from Joanne and David, add acks

Patches in v2 All 7 applied

#Subject and filesSizeRepliesApplied
1/7bpf: Refactor ARG_PTR_TO_DYNPTR checks into process_dynptr_funcinclude/linux/bpf_verifier.h kernel/bpf/verifier.c tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c +1 more+75 -860 repliesApplied
2/7bpf: Propagate errors from process_* checks in check_func_argkernel/bpf/verifier.c+15 -100 repliesApplied
3/7bpf: Rework process_dynptr_funcinclude/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/helpers.c +4 more+191 -790 repliesApplied
4/7bpf: Rework check_func_arg_reg_offkernel/bpf/verifier.c tools/testing/selftests/bpf/verifier/calls.c tools/testing/selftests/bpf/verifier/ringbuf.c+41 -271 replyApplied
5/7bpf: Move PTR_TO_STACK alignment check to process_dynptr_funckernel/bpf/verifier.c+8 -50 repliesApplied
6/7bpf: Use memmove for bpf_dynptr_{read,write}kernel/bpf/helpers.c+10 -20 repliesApplied
7/7selftests/bpf: Add test for dynptr reinit in user_ringbuf callbacktools/testing/selftests/bpf/prog_tests/user_ringbuf.c tools/testing/selftests/bpf/progs/user_ringbuf_fail.c+45 -80 repliesApplied

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchDavid VernetJoanne Koong
1/7A-b A-b
2/7A-b
3/7A-b
4/7A-b A-b
5/7A-b
6/7A-b A-b
7/7A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/7] Dynptr refactorings

This is part 1 of https://lore.kernel.org/bpf/[email protected].
This thread also gives some background on why the refactor is being done:
https://lore.kernel.org/bpf/CAEf4Bzb4beTHgVo+G+jehSj8oCeAjRbRcm6MRe=Gr+cajRBwEw@mail.gmail.com

As requested in patch 6 by Alexei, it only includes patches which refactors the code, on top of which further fixes will be made in part
2. The refactor itself fixes another issue as a side effect. No functional change is intended (except a few modified log messages).

Changelog:
----------
v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]

* Address feedback from Joanne and David, add acks

Fixes v1 -> v1
Fixes v1: https://lore.kernel.org/bpf/[email protected]

* Collect acks from Joanne and David
* Fix misc nits pointed out by Joanne, David
* Split move of reg->off alignment check for dynptr into separate change (Alexei)

Kumar Kartikeya Dwivedi (7):
bpf: Refactor ARG_PTR_TO_DYNPTR checks into process_dynptr_func
bpf: Propagate errors from process_* checks in check_func_arg
bpf: Rework process_dynptr_func
bpf: Rework check_func_arg_reg_off
bpf: Move PTR_TO_STACK alignment check to process_dynptr_func
bpf: Use memmove for bpf_dynptr_{read,write} selftests/bpf: Add test for dynptr reinit in user_ringbuf callback

 include/linux/bpf.h                           |   4 +-
 include/linux/bpf_verifier.h                  |   8 +-
 include/uapi/linux/bpf.h                      |   8 +-
 kernel/bpf/helpers.c                          |  30 +-
 kernel/bpf/verifier.c                         | 435 ++++++++++++------
 scripts/bpf_doc.py                            |   1 +
 tools/include/uapi/linux/bpf.h                |   8 +-
 .../bpf/prog_tests/kfunc_dynptr_param.c       |   7 +-
 .../selftests/bpf/prog_tests/user_ringbuf.c   |   6 +-
 .../bpf/progs/test_kfunc_dynptr_param.c       |  12 -
 .../selftests/bpf/progs/user_ringbuf_fail.c   |  51 +-
 tools/testing/selftests/bpf/verifier/calls.c  |   2 +-
 .../testing/selftests/bpf/verifier/ringbuf.c  |   2 +-
 13 files changed, 371 insertions(+), 203 deletions(-)

base-commit: e9b4aeed56699b469206d05e706ddf2db95700a9

Signature · 1 line
2.38.1