net: dev_close() should check IFF_UP
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 10 May 2011 19:26:06 +0000 (12:26 -0700)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:25 +0000 (14:23 -0500)
commitb9aa55979f1fbb27c6625810edc56556afce62d1
treef158fb4ac9019cac5b457b3557e10f312992fed7
parentae6406777d44dfd90e5e557c4f62ecf0fca56a0e
net: dev_close() should check IFF_UP

BugLink: http://bugs.launchpad.net/bugs/788691

commit e14a599335427f81bbb0008963e59aa9c6449dce upstream.

Commit 443457242beb (factorize sync-rcu call in
unregister_netdevice_many) mistakenly removed one test from dev_close()

Following actions trigger a BUG :

modprobe bonding
modprobe dummy
ifconfig bond0 up
ifenslave bond0 dummy0
rmmod dummy

dev_close() must not close a non IFF_UP device.

With help from Frank Blaschka and Einar EL Lueck

Reported-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Reported-by: Einar EL Lueck <ELELUECK@de.ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
net/core/dev.c