]> Git Repo - linux.git/commit
cgroup: bpf: Add bpf_skb_in_cgroup_proto
authorMartin KaFai Lau <[email protected]>
Thu, 30 Jun 2016 17:28:44 +0000 (10:28 -0700)
committerDavid S. Miller <[email protected]>
Fri, 1 Jul 2016 20:32:13 +0000 (16:32 -0400)
commit4a482f34afcc162d8456f449b137ec2a95be60d8
tree0eb3ace759a7df82f868dc4d999fb65f120cabb2
parent4ed8ec521ed57c4e207ad464ca0388776de74d4b
cgroup: bpf: Add bpf_skb_in_cgroup_proto

Adds a bpf helper, bpf_skb_in_cgroup, to decide if a skb->sk
belongs to a descendant of a cgroup2.  It is similar to the
feature added in netfilter:
commit c38c4597e4bf ("netfilter: implement xt_cgroup cgroup2 path match")

The user is expected to populate a BPF_MAP_TYPE_CGROUP_ARRAY
which will be used by the bpf_skb_in_cgroup.

Modifications to the bpf verifier is to ensure BPF_MAP_TYPE_CGROUP_ARRAY
and bpf_skb_in_cgroup() are always used together.

Signed-off-by: Martin KaFai Lau <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Tejun Heo <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
include/uapi/linux/bpf.h
kernel/bpf/verifier.c
net/core/filter.c
This page took 0.058657 seconds and 4 git commands to generate.