From: Thomas Haller <thaller@redhat.com>
To: Thomas Graf <tgraf@suug.ch>,
Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Jiri Benc <jbenc@redhat.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net] net: try harder to not reuse ifindex when moving interfaces
Date: Fri, 23 Oct 2015 12:40:03 +0200 [thread overview]
Message-ID: <1445596803.3268.31.camel@redhat.com> (raw)
In-Reply-To: <20151022185629.GI23554@pox.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
On Thu, 2015-10-22 at 20:56 +0200, Thomas Graf wrote:
> On 10/22/15 at 07:21pm, Hannes Frederic Sowa wrote:
> > Hi Thomas,
> >
> > On Thu, Oct 22, 2015, at 18:45, Thomas Graf wrote:
> > > I understand the race but when does it occur? Whoever creates
> > > the original interface owns it and is responsible for its
> > > lifecycle. *Iff* for some reason multiple entities manipulate
> > > the interface, then it's probably a lot safer to just use flock
> > > or something similar to serialize access entirely in user space.
> >
> > This only works if all networking configuration programs would
> > standardize on the same flock. Also, under memory pressure we lose
> > netlink monitor messages, so we need to deal with timeouts and
> > retries
> > and manual sync up on the networking configuration, which makes
> > this
> > scheme a lot harder. For normal socket io, where we specify e.g.
> > ifindex
> > in sin6_addr, this is not really usable at all.
>
> Again, what is the scenario where this happens? Is this being
> hit or are we talking theoretical races? I'd like to understand
> the background of this.
ip netns add N1
ip netns add N2
ip netns exec N1 ip link add type dummy
ip netns exec N2 ip link add type dummy
ip netns exec N1 ip monitor &
ip netns exec N1 ip link delete dummy0
ip netns exec N2 ip link set dummy0 netns N1
Honestly, I didn't experience a concrete bug due to this.
But it's common to treat the ifindex as unique identifier.
By reusing the ifindex immediately as in the example above, it
could happen to mix up interfaces.
Thomas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-10-23 10:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 11:07 [PATCH net] net: try harder to not reuse ifindex when moving interfaces Jiri Benc
2015-10-18 15:11 ` Alexei Starovoitov
2015-10-19 9:06 ` Jiri Benc
2015-10-19 15:36 ` Alexei Starovoitov
2015-10-21 14:43 ` David Miller
2015-10-21 14:46 ` Jiri Benc
2015-10-21 15:32 ` David Miller
2015-10-21 15:25 ` Jiri Benc
2015-10-21 15:56 ` David Miller
2015-10-21 17:12 ` Hannes Frederic Sowa
2015-10-22 14:52 ` Nicolas Dichtel
2015-10-22 15:00 ` Jiri Benc
2015-10-22 15:10 ` Hannes Frederic Sowa
2015-10-22 15:20 ` Thomas Haller
2015-10-22 15:23 ` Nicolas Dichtel
2015-10-22 16:45 ` Thomas Graf
2015-10-22 17:21 ` Hannes Frederic Sowa
2015-10-22 18:56 ` Thomas Graf
2015-10-23 10:40 ` Thomas Haller [this message]
2015-10-22 15:21 ` Thomas Haller
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=1445596803.3268.31.camel@redhat.com \
--to=thaller@redhat.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=jbenc@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=tgraf@suug.ch \
/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).