]> git.hungrycats.org Git - linux/commit
igb: close/suspend race in netif_device_detach
authorTodd Fujinaka <todd.fujinaka@intel.com>
Tue, 15 Nov 2016 16:54:26 +0000 (08:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:21:19 +0000 (09:21 +0100)
commitba83011a470cc1246d24a41ca2fe6047799f27e7
tree738f57828b8d714b98522896cf12ca487678f4ce
parent559a208028387ffb230f502f8137c278b311803b
igb: close/suspend race in netif_device_detach

[ Upstream commit 9474933caf21a4cb5147223dca1551f527aaac36 ]

Similar to ixgbe, when an interface is part of a namespace it is
possible that igb_close() may be called while __igb_shutdown() is
running which ends up in a double free WARN and/or a BUG in
free_msi_irqs().

Extend the rtnl_lock() to protect the call to netif_device_detach() and
igb_clear_interrupt_scheme() in __igb_shutdown() and check for
netif_device_present() to avoid calling igb_clear_interrupt_scheme() a
second time in igb_close().

Also extend the rtnl lock in igb_resume() to netif_device_attach().

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/igb/igb_main.c