netfilter: implement xt_cgroup cgroup2 path match
authorTejun Heo <tj@kernel.org>
Mon, 7 Dec 2015 22:38:55 +0000 (17:38 -0500)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Dec 2015 19:34:55 +0000 (20:34 +0100)
commitc38c4597e4bf3e99860eac98211748e1ecb0e139
treec24fde86bfd2353a1087f7c42f62a14c805931ae
parent4ec8ff0edccffe7a77f18e2a1e2ce86f03e08b5c
netfilter: implement xt_cgroup cgroup2 path match

This patch implements xt_cgroup path match which matches cgroup2
membership of the associated socket.  The match is recursive and
invertible.

For rationales on introducing another cgroup based match, please refer
to a preceding commit "sock, cgroup: add sock->sk_cgroup".

v3: Folded into xt_cgroup as a new revision interface as suggested by
    Pablo.

v2: Included linux/limits.h from xt_cgroup2.h for PATH_MAX.  Added
    explicit alignment to the priv field.  Both suggested by Jan.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>
CC: Neil Horman <nhorman@tuxdriver.com>
Cc: Jan Engelhardt <jengelh@inai.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/xt_cgroup.h
net/netfilter/xt_cgroup.c