public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jan Engelhardt <jengelh@inai.de>
Cc: davem@davemloft.net, pablo@netfilter.org, kaber@trash.net,
	kadlec@blackhole.kfki.hu, lizefan@huawei.com, hannes@cmpxchg.org,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@fb.com,
	daniel@iogearbox.net, daniel.wagner@bmw-carit.de,
	nhorman@tuxdriver.com
Subject: Re: [PATCH iptables] libxt_cgroup2: add support for cgroup2 path matching
Date: Tue, 17 Nov 2015 18:09:24 -0500	[thread overview]
Message-ID: <20151117230924.GL22864@mtj.duckdns.org> (raw)
In-Reply-To: <alpine.LSU.2.20.1511172356570.13966@nerf40.vanv.qr>

Hello,

On Wed, Nov 18, 2015 at 12:02:01AM +0100, Jan Engelhardt wrote:
> On Tuesday 2015-11-17 20:42, Tejun Heo wrote:
> >+static void cgroup2_save(const void *ip, const struct xt_entry_match *match)
> >+{
> >+	const struct xt_cgroup2_info *info = (void *)match->data;
> >+
> >+	printf("%s --path %s", info->invert ? " !" : "", info->path);
> >+}
> 
> Can cgroup path names contain anything fancy, like spaces, backslashes, etc.?
> If so, xtables_save_string() will be needed here.

Will update.

> >+static struct xtables_match cgroup2_match = {
> >+	.family		= NFPROTO_UNSPEC,
> >+	.name		= "cgroup2",
> >+	.version	= XTABLES_VERSION,
> >+	.size		= XT_ALIGN(sizeof(struct xt_cgroup2_info)),
> >+	.userspacesize	= XT_ALIGN(sizeof(struct xt_cgroup2_info)),
> 
> userspacesize must not include xt_cgroup2_info.priv.
> Change to offsetof(...), cf. other .c modules which do this.

Ah, okay.

...
> >+\fBIMPORTANT\fP: when being used in the INPUT chain, the cgroup2
> >+matcher is currently only of limited functionality, meaning it
> >+will only match on packets that are processed for local sockets
> >+through early socket demuxing. Therefore, general usage on the
> >+INPUT chain is disadviced unless the implications are well
> 
> is disadviced (sic)  -> is not advised

Will update.  That's copied verbatim from xt_cgroup tho.  Will create
a patch to update that too.

Thanks.

-- 
tejun

      reply	other threads:[~2015-11-17 23:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 19:40 [PATCHSET] netfilter, cgroup: implement xt_cgroup2 match Tejun Heo
2015-11-17 19:40 ` [PATCH 1/5] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it Tejun Heo
2015-11-17 22:54   ` Jan Engelhardt
2015-11-17 23:03     ` Tejun Heo
2015-11-17 19:40 ` [PATCH 2/5] kernfs: implement kernfs_walk_and_get() Tejun Heo
2015-11-17 21:20   ` David Miller
2015-11-17 21:22     ` Tejun Heo
2015-11-17 22:48     ` Jan Engelhardt
2015-11-17 19:40 ` [PATCH 3/5] cgroup: implement cgroup_get_from_path() and expose cgroup_put() Tejun Heo
2015-11-17 19:40 ` [PATCH 4/5] sock, cgroup: add sock->sk_cgroup Tejun Heo
2015-11-17 21:25   ` David Miller
2015-11-17 21:31     ` Tejun Heo
2015-11-17 21:46       ` David Miller
2015-11-17 21:48       ` Daniel Borkmann
2015-11-17 22:17         ` Tejun Heo
2015-11-17 21:46   ` Daniel Borkmann
2015-11-17 22:21     ` Tejun Heo
2015-11-17 19:40 ` [PATCH 5/5] netfilter: implement xt_cgroup2 match Tejun Heo
2015-11-17 22:56   ` Jan Engelhardt
2015-11-17 19:42 ` [PATCH iptables] libxt_cgroup2: add support for cgroup2 path matching Tejun Heo
2015-11-17 23:02   ` Jan Engelhardt
2015-11-17 23:09     ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151117230924.GL22864@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hannes@cmpxchg.org \
    --cc=jengelh@inai.de \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox