From: ebiederm@xmission.com (Eric W. Biederman)
To: Cong Wang <cwang@twopensource.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
netdev <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: Re: [PATCH] net: clear iflink when moving to a new netns
Date: Wed, 12 Feb 2014 18:00:47 -0800 [thread overview]
Message-ID: <87sirn4vqo.fsf@xmission.com> (raw)
In-Reply-To: <CAHA+R7Pd07-3-ikK9=o=6ZhwT1PY6iZTmLUnCCsJ2-e=KS5jOA@mail.gmail.com> (Cong Wang's message of "Wed, 12 Feb 2014 17:18:08 -0800")
Cong Wang <cwang@twopensource.com> writes:
> On Wed, Feb 12, 2014 at 7:43 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>> Le 12/02/2014 00:51, Cong Wang a écrit :
>>
>>> From: Cong Wang <cwang@twopensource.com>
>>>
>>> BZ: https://bugzilla.kernel.org/show_bug.cgi?id=66691
>>>
>>> macvlan and vlan both use iflink to identify its lower device,
>>> however, after such device is moved to the new netns, its iflink
>>> would become meaningless as ifindex is per netns. So, instead of
>>> forbid them moving to another netns, just clear this field so that
>>> it will not be dumped at least.
>>>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: Eric W. Biederman <ebiederm@xmission.com>
>>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>>> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>,
>>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>>> Signed-off-by: Cong Wang <cwang@twopensource.com>
>>
>> I wonder if this patch breaks things in ip tunnels.
>> For example, ip6_tunnel uses iflink to find tunnels that are bound to an
>> interface.
>> If you reset this field, ipip6_tunnel_lookup() will fail when the tunnel
>> moves
>> to another netns.
>
> Most tunnels set NETIF_F_NETNS_LOCAL, ip6_tunnel should set it too
> (need a patch). So this is not a problem.
There was an effort not long ago to make tunnels safe to pass between
namespaces. NETIF_F_NETNS_LOCAL was removed from ip6_tunnel in that
effort. Apparently something was overlooked.
Making iflink a netdevice reference or finding a way to remove it
entirely seems better that masking the problem.
Eric
next prev parent reply other threads:[~2014-02-13 2:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 23:51 [PATCH] net: clear iflink when moving to a new netns Cong Wang
2014-02-11 23:51 ` [PATCH] macvlan: unregister net device when netdev_upper_dev_link() fails Cong Wang
2014-02-13 22:13 ` David Miller
2014-02-11 23:51 ` [PATCH] net: correct error path in rtnl_newlink() Cong Wang
2014-02-13 22:13 ` David Miller
2014-02-12 15:43 ` [PATCH] net: clear iflink when moving to a new netns Nicolas Dichtel
2014-02-13 1:18 ` Cong Wang
2014-02-13 2:00 ` Eric W. Biederman [this message]
2014-02-13 22:44 ` Cong Wang
2014-02-12 16:33 ` Stephen Hemminger
2014-02-13 1:20 ` Cong Wang
2014-02-13 2:01 ` Eric W. Biederman
2014-02-12 23:18 ` Ben Hutchings
2014-02-13 1:34 ` Cong Wang
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=87sirn4vqo.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=xiyou.wangcong@gmail.com \
/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).