mbox series

[bpf-next,v2,0/7] Dynptr refactorings

Message ID 20221207204141.308952-1-memxor@gmail.com (mailing list archive)
Headers show
Series Dynptr refactorings | expand

Message

Kumar Kartikeya Dwivedi Dec. 7, 2022, 8:41 p.m. UTC
This is part 1 of https://lore.kernel.org/bpf/20221018135920.726360-1-memxor@gmail.com.
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/20221115000130.1967465-1-memxor@gmail.com

 * Address feedback from Joanne and David, add acks

Fixes v1 -> v1
Fixes v1: https://lore.kernel.org/bpf/20221018135920.726360-1-memxor@gmail.com

 * 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

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 9, 2022, 2:50 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu,  8 Dec 2022 02:11:34 +0530 you wrote:
> This is part 1 of https://lore.kernel.org/bpf/20221018135920.726360-1-memxor@gmail.com.
> 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).
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/7] bpf: Refactor ARG_PTR_TO_DYNPTR checks into process_dynptr_func
    https://git.kernel.org/bpf/bpf-next/c/6b75bd3d0367
  - [bpf-next,v2,2/7] bpf: Propagate errors from process_* checks in check_func_arg
    https://git.kernel.org/bpf/bpf-next/c/ac50fe51ce87
  - [bpf-next,v2,3/7] bpf: Rework process_dynptr_func
    https://git.kernel.org/bpf/bpf-next/c/270605317366
  - [bpf-next,v2,4/7] bpf: Rework check_func_arg_reg_off
    https://git.kernel.org/bpf/bpf-next/c/184c9bdb8f65
  - [bpf-next,v2,5/7] bpf: Move PTR_TO_STACK alignment check to process_dynptr_func
    https://git.kernel.org/bpf/bpf-next/c/f6ee298fa140
  - [bpf-next,v2,6/7] bpf: Use memmove for bpf_dynptr_{read,write}
    https://git.kernel.org/bpf/bpf-next/c/76d16077bef0
  - [bpf-next,v2,7/7] selftests/bpf: Add test for dynptr reinit in user_ringbuf callback
    https://git.kernel.org/bpf/bpf-next/c/292064cce796

You are awesome, thank you!