mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
bpf: Fix refcount check in check_struct_ops_btf_id()
[ Upstream commit25e3e1f109] 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:38f1e66abd("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a1a8a8bdfa
commit
0b69217310
@@ -23687,7 +23687,7 @@ static int check_struct_ops_btf_id(struct bpf_verifier_env *env)
|
||||
}
|
||||
|
||||
for (i = 0; i < st_ops_desc->arg_info[member_idx].cnt; i++) {
|
||||
if (st_ops_desc->arg_info[member_idx].info->refcounted) {
|
||||
if (st_ops_desc->arg_info[member_idx].info[i].refcounted) {
|
||||
has_refcounted_arg = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user