From: Florian Westphal <fw@strlen.de>
To: Kevin Cernekee <cernekee@chromium.org>
Cc: 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:02:23 +0200 [thread overview]
Message-ID: <20160614000223.GC16798@breakpoint.cc> (raw)
In-Reply-To: <1465850579-23431-1-git-send-email-cernekee@chromium.org>
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.
next prev parent reply other threads:[~2016-06-14 0:02 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 [this message]
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
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=20160614000223.GC16798@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 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).