]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bonding: fix panic on non-ARPHRD_ETHER enslave failure
authorJay Vosburgh <jay.vosburgh@canonical.com>
Sat, 7 Nov 2015 01:23:23 +0000 (17:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:34:10 +0000 (14:34 -0500)
commit1c88ba236f4040530a98ca81d0316bd03fb5a41f
tree79577d98f554038262edc83f53f7e9f709a5035b
parent1e2d4ae7356d809aa52a6fa406d441b321ac7827
bonding: fix panic on non-ARPHRD_ETHER enslave failure

[ Upstream commit 40baec225765c54eefa870530dd613bad9829bb7 ]

Since commit 7d5cd2ce529b, when bond_enslave fails on devices that
are not ARPHRD_ETHER, if needed, it resets the bonding device back to
ARPHRD_ETHER by calling ether_setup.

Unfortunately, ether_setup clobbers dev->flags, clearing IFF_UP
if the bond device is up, leaving it in a quasi-down state without
having actually gone through dev_close.  For bonding, if any periodic
work queue items are active (miimon, arp_interval, etc), those will
remain running, as they are stopped by bond_close.  At this point, if
the bonding module is unloaded or the bond is deleted, the system will
panic when the work function is called.

This panic is resolved by calling dev_close on the bond itself
prior to calling ether_setup.

Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Fixes: 7d5cd2ce5292 ("bonding: correctly handle bonding type change on enslave failure")
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/bonding/bond_main.c