Race with netdevice unregister and dst_dev_event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Switching Ethernet Bridge code over to using a dev->destructor
made the code cleaner, but there is now a race with the dst cache.
Basically, the GC code fires later and dereferences the destructor
in the module (which is now unloaded).

The problem is that dst_dev_event gets notified when a device is
getting unregistered, but it doesn't clean up.  There is a cryptic
comment that this is intentional, and I don't know the history.

			if (dst->dev == dev) {
				/* Dirty hack. We did it in 2.2 (in __dst_free),
				   we have _very_ good reasons not to repeat
				   this mistake in 2.3, but we have no choice
				   now. _It_ _is_ _explicit_ _deliberate_
				   _race_ _condition_.
				 */



So unless dst.c is fixed, there needs to be a rule NEVER use
dev->destructor in network modules.

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux