summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2017-10-03 01:50:22 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-04 19:05:05 -0400
commit468e2f64d220fe2dc11caa2bcb9b3a1e50fc7321 (patch)
treeda21e580b4a534f6feab72ba479b6d3e0ad951f1 /kernel/cgroup
parent324bda9e6c5add86ba2e1066476481c48132aca0 (diff)
bpf: introduce BPF_PROG_QUERY command
introduce BPF_PROG_QUERY command to retrieve a set of either attached programs to given cgroup or a set of effective programs that will execute for events within a cgroup Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> for cgroup bits Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r--kernel/cgroup/cgroup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 57eb866ae78d..269512b94a94 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5761,4 +5761,14 @@ int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
5761 mutex_unlock(&cgroup_mutex); 5761 mutex_unlock(&cgroup_mutex);
5762 return ret; 5762 return ret;
5763} 5763}
5764int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
5765 union bpf_attr __user *uattr)
5766{
5767 int ret;
5768
5769 mutex_lock(&cgroup_mutex);
5770 ret = __cgroup_bpf_query(cgrp, attr, uattr);
5771 mutex_unlock(&cgroup_mutex);
5772 return ret;
5773}
5764#endif /* CONFIG_CGROUP_BPF */ 5774#endif /* CONFIG_CGROUP_BPF */