This is part 2 of https://lore.kernel.org/bpf/20221018135920.726360-1-memxor@xxxxxxxxx. Changelog: ---------- v1 -> v2 v1: https://lore.kernel.org/bpf/20230101083403.332783-1-memxor@xxxxxxxxx * Return error early in case of overwriting referenced dynptr slots (Andrii, Joanne) * Rename destroy_stack_slots_dynptr to destroy_if_dynptr_stack_slot (Joanne) * Invalidate dynptr slices associated with dynptr in destroy_if_dynptr_stack_slot (Joanne) * Combine both dynptr_get_spi and is_spi_bounds_valid (Joanne) * Compute spi once in process_dynptr_func and pass it as parameter instead of recomputing (Joanne) * Add comments expanding REG_LIVE_WRITTEN marking in unmark_stack_slots_dynptr (Joanne) * Add comments explaining why destroy_if_dynptr_stack_slot call needs to be done for both spi and spi - 1 (Joanne) * Port BPF assembly tests from test_verifier to test_progs framework (Andrii) * Address misc feedback, rebase to bpf-next Old v1 -> v1 Old v1: https://lore.kernel.org/bpf/20221018135920.726360-1-memxor@xxxxxxxxx * Allow overwriting dynptr stack slots from dynptr init helpers * Fix a bug in alignment check where reg->var_off.value was still not included * Address other minor nits Eduard Zingerman (1): selftests/bpf: convenience macro for use with 'asm volatile' blocks Kumar Kartikeya Dwivedi (10): bpf: Fix state pruning for STACK_DYNPTR stack slots bpf: Fix missing var_off check for ARG_PTR_TO_DYNPTR bpf: Fix partial dynptr stack slot reads/writes bpf: Allow reinitializing unreferenced dynptr stack slots bpf: Combine dynptr_get_spi and is_spi_bounds_valid bpf: Avoid recomputing spi in process_dynptr_func selftests/bpf: Add dynptr pruning tests selftests/bpf: Add dynptr var_off tests selftests/bpf: Add dynptr partial slot overwrite tests selftests/bpf: Add dynptr helper tests kernel/bpf/verifier.c | 347 +++++++++++++++--- .../bpf/prog_tests/kfunc_dynptr_param.c | 2 +- tools/testing/selftests/bpf/progs/bpf_misc.h | 7 + .../testing/selftests/bpf/progs/dynptr_fail.c | 319 +++++++++++++++- 4 files changed, 611 insertions(+), 64 deletions(-) base-commit: 92afc5329a5b23d876b215b783d200352d5aaea6 -- 2.39.1