Lines Matching refs:type
41 enum bpf_attach_type type, in bpf_cgroup_storages_alloc() argument
50 key.attach_type = type; in bpf_cgroup_storages_alloc()
116 unsigned int type; in cgroup_bpf_release() local
120 for (type = 0; type < ARRAY_SIZE(cgrp->bpf.progs); type++) { in cgroup_bpf_release()
121 struct list_head *progs = &cgrp->bpf.progs[type]; in cgroup_bpf_release()
134 cgrp->bpf.effective[type], in cgroup_bpf_release()
199 enum bpf_attach_type type) in hierarchy_allows_attach() argument
207 u32 flags = p->bpf.flags[type]; in hierarchy_allows_attach()
212 cnt = prog_list_length(&p->bpf.progs[type]); in hierarchy_allows_attach()
228 enum bpf_attach_type type, in compute_effective_progs() argument
239 if (cnt == 0 || (p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
240 cnt += prog_list_length(&p->bpf.progs[type]); in compute_effective_progs()
252 if (cnt > 0 && !(p->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in compute_effective_progs()
255 list_for_each_entry(pl, &p->bpf.progs[type], node) { in compute_effective_progs()
272 enum bpf_attach_type type, in activate_effective_progs() argument
275 old_array = rcu_replace_pointer(cgrp->bpf.effective[type], old_array, in activate_effective_progs()
331 enum bpf_attach_type type) in update_effective_progs() argument
343 err = compute_effective_progs(desc, type, &desc->bpf.inactive); in update_effective_progs()
360 activate_effective_progs(desc, type, desc->bpf.inactive); in update_effective_progs()
436 enum bpf_attach_type type, u32 flags) in __cgroup_bpf_attach() argument
439 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_attach()
457 if (!hierarchy_allows_attach(cgrp, type)) in __cgroup_bpf_attach()
460 if (!list_empty(progs) && cgrp->bpf.flags[type] != saved_flags) in __cgroup_bpf_attach()
475 if (bpf_cgroup_storages_alloc(storage, new_storage, type, in __cgroup_bpf_attach()
493 cgrp->bpf.flags[type] = saved_flags; in __cgroup_bpf_attach()
495 err = update_effective_progs(cgrp, type); in __cgroup_bpf_attach()
503 bpf_cgroup_storages_link(new_storage, cgrp, type); in __cgroup_bpf_attach()
523 enum bpf_attach_type type, in replace_effective_prog() argument
542 if (pos && !(cg->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in replace_effective_prog()
545 head = &cg->bpf.progs[type]; in replace_effective_prog()
557 desc->bpf.effective[type], in replace_effective_prog()
577 struct list_head *progs = &cgrp->bpf.progs[link->type]; in __cgroup_bpf_replace()
582 if (link->link.prog->type != new_prog->type) in __cgroup_bpf_replace()
595 replace_effective_prog(cgrp, link->type, link); in __cgroup_bpf_replace()
668 enum bpf_attach_type type) in purge_effective_progs() argument
686 if (pos && !(cg->bpf.flags[type] & BPF_F_ALLOW_MULTI)) in purge_effective_progs()
689 head = &cg->bpf.progs[type]; in purge_effective_progs()
703 desc->bpf.effective[type], in purge_effective_progs()
724 struct bpf_cgroup_link *link, enum bpf_attach_type type) in __cgroup_bpf_detach() argument
726 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_detach()
727 u32 flags = cgrp->bpf.flags[type]; in __cgroup_bpf_detach()
744 if (update_effective_progs(cgrp, type)) { in __cgroup_bpf_detach()
748 purge_effective_progs(cgrp, old_prog, link, type); in __cgroup_bpf_detach()
756 cgrp->bpf.flags[type] = 0; in __cgroup_bpf_detach()
768 enum bpf_attach_type type = attr->query.attach_type; in __cgroup_bpf_query() local
769 struct list_head *progs = &cgrp->bpf.progs[type]; in __cgroup_bpf_query()
770 u32 flags = cgrp->bpf.flags[type]; in __cgroup_bpf_query()
775 effective = rcu_dereference_protected(cgrp->bpf.effective[type], in __cgroup_bpf_query()
886 cg_link->type)); in bpf_cgroup_link_release()
927 cg_link->type); in bpf_cgroup_link_show_fdinfo()
943 info->cgroup.attach_type = cg_link->type; in bpf_cgroup_link_fill_link_info()
978 link->type = attr->link_create.attach_type; in cgroup_bpf_link_attach()
986 err = cgroup_bpf_attach(cgrp, NULL, NULL, link, link->type, in cgroup_bpf_link_attach()
1041 enum bpf_attach_type type) in __cgroup_bpf_run_filter_skb() argument
1063 if (type == BPF_CGROUP_INET_EGRESS) { in __cgroup_bpf_run_filter_skb()
1065 cgrp->bpf.effective[type], skb, __bpf_prog_run_save_cb); in __cgroup_bpf_run_filter_skb()
1067 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], skb, in __cgroup_bpf_run_filter_skb()
1093 enum bpf_attach_type type) in __cgroup_bpf_run_filter_sk() argument
1098 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sk, BPF_PROG_RUN); in __cgroup_bpf_run_filter_sk()
1118 enum bpf_attach_type type, in __cgroup_bpf_run_filter_sock_addr() argument
1142 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, BPF_PROG_RUN); in __cgroup_bpf_run_filter_sock_addr()
1166 enum bpf_attach_type type) in __cgroup_bpf_run_filter_sock_ops() argument
1171 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], sock_ops, in __cgroup_bpf_run_filter_sock_ops()
1178 short access, enum bpf_attach_type type) in __cgroup_bpf_check_dev_permission() argument
1190 allow = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, in __cgroup_bpf_check_dev_permission()
1221 enum bpf_access_type type, in cgroup_dev_is_valid_access() argument
1227 if (type == BPF_WRITE) in cgroup_dev_is_valid_access()
1282 enum bpf_attach_type type) in __cgroup_bpf_run_filter_sysctl() argument
1322 ret = BPF_PROG_RUN_ARRAY(cgrp->bpf.effective[type], &ctx, BPF_PROG_RUN); in __cgroup_bpf_run_filter_sysctl()
1720 static bool sysctl_is_valid_access(int off, int size, enum bpf_access_type type, in sysctl_is_valid_access() argument
1731 if (type != BPF_READ) in sysctl_is_valid_access()
1736 if (type == BPF_READ) { in sysctl_is_valid_access()
1747 static u32 sysctl_convert_ctx_access(enum bpf_access_type type, in sysctl_convert_ctx_access() argument
1770 if (type == BPF_WRITE) { in sysctl_convert_ctx_access()
1838 enum bpf_access_type type, in cg_sockopt_is_valid_access() argument
1850 if (type == BPF_WRITE) { in cg_sockopt_is_valid_access()
1904 static u32 cg_sockopt_convert_ctx_access(enum bpf_access_type type, in cg_sockopt_convert_ctx_access() argument
1917 if (type == BPF_WRITE) in cg_sockopt_convert_ctx_access()
1923 if (type == BPF_WRITE) in cg_sockopt_convert_ctx_access()
1929 if (type == BPF_WRITE) in cg_sockopt_convert_ctx_access()
1935 if (type == BPF_WRITE) in cg_sockopt_convert_ctx_access()