Please sign in to comment.
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 c38c459 ("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@example.com> Cc: Alexei Starovoitov <firstname.lastname@example.org> Cc: Daniel Borkmann <email@example.com> Cc: Tejun Heo <firstname.lastname@example.org> Acked-by: Alexei Starovoitov <email@example.com> Signed-off-by: David S. Miller <firstname.lastname@example.org>
- Loading branch information...
Showing with 56 additions and 1 deletion.