mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
selftests: bpf: fix cgroup_hierarchical_stats
The cgroup_hierarchical_stats selftests uses an fentry program attached to cgroup_attach_task and then passes the received &dst_cgrp->self to the css_rstat_updated() kfunc. The verifier now assumes that all kfuncs only takes trusted pointer arguments, and pointers received by fentry are not marked trustes by default. Use a tp_btf program in place for fentry for this test, pointers received by tp_btf programs are marked trusted by the verifier. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Link: https://lore.kernel.org/r/20260102180038.2708325-10-puranjay@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
230b0118e4
commit
cf82580c86
|
|
@ -62,9 +62,9 @@ static int create_attach_counter(__u64 cg_id, __u64 state, __u64 pending)
|
|||
&init, BPF_NOEXIST);
|
||||
}
|
||||
|
||||
SEC("fentry/cgroup_attach_task")
|
||||
int BPF_PROG(counter, struct cgroup *dst_cgrp, struct task_struct *leader,
|
||||
bool threadgroup)
|
||||
SEC("tp_btf/cgroup_attach_task")
|
||||
int BPF_PROG(counter, struct cgroup *dst_cgrp, const char *path,
|
||||
struct task_struct *task, bool threadgroup)
|
||||
{
|
||||
__u64 cg_id = cgroup_id(dst_cgrp);
|
||||
struct percpu_attach_counter *pcpu_counter = bpf_map_lookup_elem(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user