[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231013154302.44cc197d@kernel.org>
Date: Fri, 13 Oct 2023 15:43:02 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Daniel Gröber <dxld@...kboxed.org>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, netdev@...r.kernel.org, Richard Weinberger
<richard@....at>, Serge Hallyn <serge.hallyn@...onical.com>, "Eric W.
Biederman" <ebiederm@...ssion.com>
Subject: Re: [BUG] rtnl_newlink: Rogue MOVE event delivered on netns change
On Fri, 13 Oct 2023 15:36:05 -0700 Jakub Kicinski wrote:
> kobject_uevent(&dev->dev.kobj, KOBJ_REMOVE);
> dev_net_set(dev, net);
> kobject_uevent(&dev->dev.kobj, KOBJ_ADD);
Greg, we seem to have a problem in networking with combined
netns move and name change.
We have this code in __dev_change_net_namespace():
kobject_uevent(&dev->dev.kobj, KOBJ_REMOVE);
dev_net_set(dev, net);
kobject_uevent(&dev->dev.kobj, KOBJ_ADD);
err = device_rename(&dev->dev, dev->name);
Is there any way we can only get the REMOVE (old name) and ADD
(new name) events, without the move? I.e. silence the rename?
Daniel is reporting that with current code target netns sees an
add of an interface with the old (duplicated) name. And then a rename.
Without a silent move best we can do is probably:
kobject_uevent(&dev->dev.kobj, KOBJ_REMOVE);
dev_net_set(dev, net);
err = device_rename(&dev->dev, dev->name);
kobject_uevent(&dev->dev.kobj, KOBJ_ADD);
which will give us:
MOVE new-name
ADD new-name
in target netns, which, hm.
Powered by blists - more mailing lists