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: <m1fxrtpg06.fsf@frodo.ebiederm.org>
Date:	Wed, 04 Jun 2008 04:59:53 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Daniel Lezcano <dlezcano@...ibm.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [net-2.6 patch 1/2][NETNS] fix device renaming for sysfs

Daniel Lezcano <dlezcano@...ibm.com> writes:

> When a netdev is moved across namespaces with the 'dev_change_net_namespace' 
> function, the 'device_rename' function is used to fixup kobject and refresh 
> the sysfs tree. The device_rename function will call kobject_rename and this
> one will check if there is an object with the same name and this is the case
> because we are renaming the object with the same name.
>
> The use of 'device_rename' seems for me wrong because we usually don't
> rename it but just move it across namespaces. As we just want to do a 
> mini "netdev_[un]register", IMO the functions 'netdev_[un]register_kobject' 
> should be used instead, like an usual network device [un]registering.

device_rename is correct.  Because doing device_del; device_add removes
any driver specific sysfs attributes.

Causing your patch to introduce subtle driver breakage only when we
move a network device between namespaces.  Ouch!

To support this operation we need something like device_rename that
can preserve driver specific attributes, and generally handle
movement between namespaces.  Since device_rename already does 99% of
what we need it to do I found it easier to extend device_rename to
handle this case then to introduce yet another function into the
kobject layer.

> This patch replace device_rename by netdev_unregister_kobject, followed by
> netdev_register_kobject.

And sysfs comes a' tumblin' down.

My apologies for not replying sooner I just spotted this.

Eric
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ