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: Fix refcount check in check_struct_ops_btf_id()

The current implementation only checks whether the first argument is
refcounted. Fix this by iterating over all arguments.

Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr>
Fixes: 38f1e66abd184 ("bpf: Do not allow tail call in strcut_ops program with __ref argument")
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Acked-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/r/20260320130219.63711-1-keisuke.nishimura@inria.fr
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Keisuke Nishimura and committed by
Alexei Starovoitov
25e3e1f1 ad2f7ed0

+1 -1
+1 -1
kernel/bpf/verifier.c
··· 24959 24959 } 24960 24960 24961 24961 for (i = 0; i < st_ops_desc->arg_info[member_idx].cnt; i++) { 24962 - if (st_ops_desc->arg_info[member_idx].info->refcounted) { 24962 + if (st_ops_desc->arg_info[member_idx].info[i].refcounted) { 24963 24963 has_refcounted_arg = true; 24964 24964 break; 24965 24965 }