[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1327575108.2500.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Thu, 26 Jan 2012 11:51:48 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Pavel Emelyanov <xemul@...allels.com>
Cc: Sjur Brændeland
<sjur.brandeland@...ricsson.com>,
"levinsasha928@...il.com" <levinsasha928@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"davej@...hat.com" <davej@...hat.com>,
"sjurbren@...il.com" <sjurbren@...il.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH] netns: fix net_alloc_generic()
Le jeudi 26 janvier 2012 à 14:44 +0400, Pavel Emelyanov a écrit :
> > I believe the problem is in net_namespace infrastructure, not in CAIF.
> >
> > Could you test following patch instead ?
> >
> > [PATCH] netns: fix net_alloc_generic()
> >
> > When a new net namespace is created, we should attach to it a "struct
> > net_generic" with enough slots (even empty), or we can hit the following
> > BUG_ON() :
> >
> > [ 200.752016] kernel BUG at include/net/netns/generic.h:40!
> > ...
> > [ 200.752016] [<ffffffff825c3cea>] ? get_cfcnfg+0x3a/0x180
> > [ 200.752016] [<ffffffff821cf0b0>] ? lockdep_rtnl_is_held+0x10/0x20
> > [ 200.752016] [<ffffffff825c41be>] caif_device_notify+0x2e/0x530
> > [ 200.752016] [<ffffffff810d61b7>] notifier_call_chain+0x67/0x110
> > [ 200.752016] [<ffffffff810d67c1>] raw_notifier_call_chain+0x11/0x20
> > [ 200.752016] [<ffffffff821bae82>] call_netdevice_notifiers+0x32/0x60
> > [ 200.752016] [<ffffffff821c2b26>] register_netdevice+0x196/0x300
> > [ 200.752016] [<ffffffff821c2ca9>] register_netdev+0x19/0x30
> > [ 200.752016] [<ffffffff81c1c67a>] loopback_net_init+0x4a/0xa0
> > [ 200.752016] [<ffffffff821b5e62>] ops_init+0x42/0x180
> > [ 200.752016] [<ffffffff821b600b>] setup_net+0x6b/0x100
> > [ 200.752016] [<ffffffff821b6466>] copy_net_ns+0x86/0x110
> > [ 200.752016] [<ffffffff810d5789>] create_new_namespaces+0xd9/0x190
> >
> > net_alloc_generic() should take into account the maximum index into the
> > ptr array, as a subsystem might use net_generic() anytime.
>
> I'm not sure I understand it correctly, but subsystem can only use the
> net_generic() only (!) after the net_assign_generic() is performed.
Yes, but here, loopback_net_init() calls register_netdev()
So every subsystems _notify are called, even if subsystem _init_net()
was not yet called.
Its a chicken and egg problem.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists