From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Florian Westphal <fw@strlen.de>,
Kevin Cernekee <cernekee@chromium.org>,
kaber@trash.net, kadlec@blackhole.kfki.hu,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH V2] net: Allow xt_owner in any user namespace
Date: Tue, 14 Jun 2016 15:23:18 +0200 [thread overview]
Message-ID: <20160614132318.GA13565@salvia> (raw)
In-Reply-To: <87wplszfpc.fsf@x220.int.ebiederm.org>
On Mon, Jun 13, 2016 at 09:06:55PM -0500, Eric W. Biederman wrote:
> Florian Westphal <fw@strlen.de> writes:
>
> > Kevin Cernekee <cernekee@chromium.org> wrote:
> >> @@ -35,6 +63,7 @@ owner_mt(const struct sk_buff *skb, struct xt_action_param *par)
> >> const struct xt_owner_match_info *info = par->matchinfo;
> >> const struct file *filp;
> >> struct sock *sk = skb_to_full_sk(skb);
> >> + const struct net *net;
> >>
> >> if (sk == NULL || sk->sk_socket == NULL)
> >> return (info->match ^ info->invert) == 0;
> >> @@ -50,9 +79,10 @@ owner_mt(const struct sk_buff *skb, struct xt_action_param *par)
> >> return ((info->match ^ info->invert) &
> >> (XT_OWNER_UID | XT_OWNER_GID)) == 0;
> >>
> >> + net = sock_net(skb->sk);
> >
> > I think you need to use sock_net(sk) as skb_to_full_sk(skb) can return something
> > other than skb->sk.
>
> Actually this should be "par->net". That did not exist a few years ago
> when the patch was written but it does now, and that should simplify
> things a little bit, and remove any guess work or uncertainty.
Right.
BTW, could you also send a follow up patch to update
net/netfilter/nft_meta.c? We have similar support for socket owner in
nf_tables as well (actually it will be a more simple patch that this,
I would expect).
Thanks.
next prev parent reply other threads:[~2016-06-14 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 20:42 [PATCH V2] net: Allow xt_owner in any user namespace Kevin Cernekee
2016-06-13 22:09 ` Eric W. Biederman
2016-06-14 0:02 ` Florian Westphal
2016-06-14 0:20 ` Eric Dumazet
2016-06-14 0:46 ` Florian Westphal
2016-06-14 2:06 ` Eric W. Biederman
2016-06-14 13:23 ` Pablo Neira Ayuso [this message]
2016-06-15 11:52 ` Eric W. Biederman
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=20160614132318.GA13565@salvia \
--to=pablo@netfilter.org \
--cc=cernekee@chromium.org \
--cc=ebiederm@xmission.com \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).