@@ -332,7 +332,6 @@ struct bpf_arg_type {
ARG_PTR_TO_SOCKET, /* pointer to bpf_sock (fullsock) */
ARG_PTR_TO_BTF_ID, /* pointer to in-kernel struct */
ARG_PTR_TO_ALLOC_MEM, /* pointer to dynamically allocated memory */
- ARG_PTR_TO_ALLOC_MEM_OR_NULL, /* pointer to dynamically allocated memory or NULL */
ARG_CONST_ALLOC_SIZE_OR_ZERO, /* number of allocated bytes requested */
ARG_PTR_TO_BTF_ID_SOCK_COMMON, /* pointer to in-kernel sock_common or bpf-mirrored bpf_sock */
ARG_PTR_TO_PERCPU_BTF_ID, /* pointer to in-kernel percpu type */
@@ -481,7 +481,6 @@ static bool arg_type_may_be_refcounted(struct bpf_arg_type arg)
static bool arg_type_may_be_null(struct bpf_arg_type arg)
{
return arg.flag & ARG_FLAG_MAYBE_NULL ||
- arg.type == ARG_PTR_TO_ALLOC_MEM_OR_NULL ||
arg.type == ARG_PTR_TO_STACK_OR_NULL;
}
@@ -5098,7 +5097,6 @@ static const struct bpf_reg_types *compatible_reg_types[__BPF_ARG_TYPE_MAX] = {
[ARG_PTR_TO_MEM] = &mem_types,
[ARG_PTR_TO_UNINIT_MEM] = &mem_types,
[ARG_PTR_TO_ALLOC_MEM] = &alloc_mem_types,
- [ARG_PTR_TO_ALLOC_MEM_OR_NULL] = &alloc_mem_types,
[ARG_PTR_TO_INT] = &int_ptr_types,
[ARG_PTR_TO_LONG] = &int_ptr_types,
[ARG_PTR_TO_PERCPU_BTF_ID] = &percpu_btf_ptr_types,
Remove ARG_PTR_TO_ALLOC_MEM_OR_NULL and use flag to mark that the argument may be null. This ARG type doesn't seem to be used anywhere. Signed-off-by: Hao Luo <haoluo@google.com> --- include/linux/bpf.h | 1 - kernel/bpf/verifier.c | 2 -- 2 files changed, 3 deletions(-)