]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] NET: Fix race condition about network device name allocation.
authorStephen Hemminger <shemminger@linux-foundation.org>
Thu, 7 Jun 2007 05:47:07 +0000 (22:47 -0700)
committerChris Wright <chrisw@sous-sol.org>
Mon, 11 Jun 2007 18:37:14 +0000 (11:37 -0700)
commit0a0b0c6034b4cbffad5ea4cac33c683bd6c04777
tree6d8ef3daf057055877539aef25965cbc26e3a701
parent9d8be79d913f3e13cc8074f02e999b860ce06862
[PATCH] NET: Fix race condition about network device name allocation.

Kenji Kaneshige found this race between device removal and
registration.  On unregister it is possible for the old device to
exist, because sysfs file is still open.  A new device with 'eth%d'
will select the same name, but sysfs kobject register will fial.

The following changes the shutdown order slightly. It hold a removes
the sysfs entries earlier (on unregister_netdevice), but holds a
kobject reference.  Then when todo runs the actual last put free
happens.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[chrisw: backport to 2.6.20]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/core/dev.c
net/core/net-sysfs.c