From: Florian Westphal <fw@strlen.de>
To: Florian Westphal <fw@strlen.de>
Cc: Kevin Cernekee <cernekee@chromium.org>,
pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu,
netfilter-devel@vger.kernel.org, ebiederm@xmission.com
Subject: Re: [PATCH V2] net: Allow xt_owner in any user namespace
Date: Tue, 14 Jun 2016 02:46:58 +0200 [thread overview]
Message-ID: <20160614004658.GD16798@breakpoint.cc> (raw)
In-Reply-To: <20160614000223.GC16798@breakpoint.cc>
Florian Westphal <fw@strlen.de> wrote:
> 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.
I was worried about layout but sk_net is part of sock_common so its
fine; comment withdrawn.
next prev parent reply other threads:[~2016-06-14 0:47 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 [this message]
2016-06-14 2:06 ` Eric W. Biederman
2016-06-14 13:23 ` Pablo Neira Ayuso
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=20160614004658.GD16798@breakpoint.cc \
--to=fw@strlen.de \
--cc=cernekee@chromium.org \
--cc=ebiederm@xmission.com \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.