lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231016184514.5dda6518@kernel.org>
Date: Mon, 16 Oct 2023 18:45:14 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Daniel Gröber <dxld@...kboxed.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.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 Tue, 17 Oct 2023 03:20:24 +0200 Daniel Gröber wrote:
> > 1. we have tb[IFLA_IFNAME] set, so do_setlink() will populate ifname
> > 
> > 2. Because of #1, __dev_change_net_namespace() gets called with 
> >    new name provide (pat = eth123)
> > 
> > 3. It will do netdev_name_in_use(), which returns true.  
> 
> At this point we're still looking at the old netns, right?

New one, already. We got it from the caller and the caller
from rtnl_link_get_net_capable().

> > 7. Now we finally call:
> > 
> >    err = device_rename(&dev->dev, dev->name);
> > 
> > Which tells device core that the name has changed, and gives you 
> > the (second) MOVE event. This time with the correct name.  
> 
> I don't like loose ends. Any idea why we only see the one MOVE now?

No, annoyingly I haven't. But I do have a host on 5.19.

[ ~]# uname -r
5.19.13-200.fc36.x86_64
[ ~]# ip netns add test
[ ~]# udevadm monitor -k &
[ ~]# ip li add name eth0 type dummy
KERNEL[67.377539] add      /module/dummy (module)
KERNEL[67.381720] add      /devices/virtual/net/eth0 (net)
KERNEL[67.381822] add      /devices/virtual/net/eth0/queues/rx-0 (queues)
KERNEL[67.381854] add      /devices/virtual/net/eth0/queues/tx-0 (queues)
[ ~]# ip -netns test li add name eth0 type dummy
[ ~]# ip -netns test link set dev eth0 netns 1 name eth1
KERNEL[99.681956] add      /devices/virtual/net/eth0 (net)
KERNEL[99.681975] move     /devices/virtual/net/eth1 (net)

I don't see it on older kernels either :S

Powered by blists - more mailing lists