bpf: Rename MEM_ALLOC to MEM_RINGBUF
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 14 Nov 2022 19:15:27 +0000 (00:45 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 Nov 2022 05:52:45 +0000 (21:52 -0800)
commit894f2a8b1673a355a1a7507a4dfa6a3c836d07c1
treefdbba646d976546607fe90cc72fb227fae130df8
parent2de2669b4e52b2ae2f118bfc310004f50b47f0f5
bpf: Rename MEM_ALLOC to MEM_RINGBUF

Currently, verifier uses MEM_ALLOC type tag to specially tag memory
returned from bpf_ringbuf_reserve helper. However, this is currently
only used for this purpose and there is an implicit assumption that it
only refers to ringbuf memory (e.g. the check for ARG_PTR_TO_ALLOC_MEM
in check_func_arg_reg_off).

Hence, rename MEM_ALLOC to MEM_RINGBUF to indicate this special
relationship and instead open the use of MEM_ALLOC for more generic
allocations made for user types.

Also, since ARG_PTR_TO_ALLOC_MEM_OR_NULL is unused, simply drop it.

Finally, update selftests using 'alloc_' verifier string to 'ringbuf_'.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20221114191547.1694267-7-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/ringbuf.c
kernel/bpf/verifier.c
tools/testing/selftests/bpf/prog_tests/dynptr.c
tools/testing/selftests/bpf/verifier/ringbuf.c
tools/testing/selftests/bpf/verifier/spill_fill.c