Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Drop reg_type_may_be_refcounted_or_null

It is not scalable to maintain a list of types that can have non-zero
ref_obj_id. It is never set for scalars anyway, so just remove the
conditional on register types and print it whenever it is non-zero.

Acked-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20221103191013.1236066-6-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Kumar Kartikeya Dwivedi and committed by
Alexei Starovoitov
a28ace78 f5e477a8

+1 -8
+1 -8
kernel/bpf/verifier.c
··· 457 457 map_value_has_spin_lock(reg->map_ptr); 458 458 } 459 459 460 - static bool reg_type_may_be_refcounted_or_null(enum bpf_reg_type type) 461 - { 462 - type = base_type(type); 463 - return type == PTR_TO_SOCKET || type == PTR_TO_TCP_SOCK || 464 - type == PTR_TO_MEM || type == PTR_TO_BTF_ID; 465 - } 466 - 467 460 static bool type_is_rdonly_mem(u32 type) 468 461 { 469 462 return type & MEM_RDONLY; ··· 868 875 869 876 if (reg->id) 870 877 verbose_a("id=%d", reg->id); 871 - if (reg_type_may_be_refcounted_or_null(t) && reg->ref_obj_id) 878 + if (reg->ref_obj_id) 872 879 verbose_a("ref_obj_id=%d", reg->ref_obj_id); 873 880 if (t != SCALAR_VALUE) 874 881 verbose_a("off=%d", reg->off);