From: ebiederm@xmission.com (Eric W. Biederman)
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
Subject: Re: [PATCH V2] net: Allow xt_owner in any user namespace
Date: Mon, 13 Jun 2016 21:06:55 -0500 [thread overview]
Message-ID: <87wplszfpc.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20160614000223.GC16798@breakpoint.cc> (Florian Westphal's message of "Tue, 14 Jun 2016 02:02:23 +0200")
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.
Eric
next prev parent reply other threads:[~2016-06-14 2:18 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 [this message]
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=87wplszfpc.fsf@x220.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=cernekee@chromium.org \
--cc=fw@strlen.de \
--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.