1
0
Fork 0
alistair23-linux/drivers/net/ethernet/intel
Francesco Ruggeri 5414f27048 igb: reinit_locked() should be called with rtnl_lock
[ Upstream commit 024a8168b7 ]

We observed two panics involving races with igb_reset_task.
The first panic is caused by this race condition:

	kworker			reboot -f

	igb_reset_task
	igb_reinit_locked
	igb_down
	napi_synchronize
				__igb_shutdown
				igb_clear_interrupt_scheme
				igb_free_q_vectors
				igb_free_q_vector
				adapter->q_vector[v_idx] = NULL;
	napi_disable
	Panics trying to access
	adapter->q_vector[v_idx].napi_state

The second panic (a divide error) is caused by this race:

kworker		reboot -f	tx packet

igb_reset_task
		__igb_shutdown
		rtnl_lock()
		...
		igb_clear_interrupt_scheme
		igb_free_q_vectors
		adapter->num_tx_queues = 0
		...
		rtnl_unlock()
rtnl_lock()
igb_reinit_locked
igb_down
igb_up
netif_tx_start_all_queues
				dev_hard_start_xmit
				igb_xmit_frame
				igb_tx_queue_mapping
				Panics on
				r_idx % adapter->num_tx_queues

This commit applies to igb_reset_task the same changes that
were applied to ixgbe in commit 2f90b8657e ("ixgbe: this patch
adds support for DCB to the kernel and ixgbe driver"),
commit 8f4c5c9fb8 ("ixgbe: reinit_locked() should be called with
rtnl_lock") and commit 88adce4ea8 ("ixgbe: fix possible race in
reset subtask").

Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-11 15:33:38 +02:00
..
e1000 e1000: Distribute switch variables for initialization 2020-06-22 09:30:58 +02:00
e1000e e1000e: Do not wake up the system via WOL if device wakeup is disabled 2020-06-24 17:50:52 +02:00
fm10k fm10k: use a local variable for the frag pointer 2019-09-09 10:08:38 -07:00
i40e i40e: protect ring accesses with READ- and WRITE_ONCE 2020-07-16 08:16:34 +02:00
iavf iavf: fix speed reporting over virtchnl 2020-06-24 17:50:44 +02:00
ice ice: fix potential double free in probe unrolling 2020-06-22 09:31:10 +02:00
igb igb: reinit_locked() should be called with rtnl_lock 2020-08-11 15:33:38 +02:00
igbvf net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
igc igb/igc: use ktime accessors for skb->tstamp 2019-11-08 16:10:51 -08:00
ixgb net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
ixgbe ixgbe: protect ring accesses with READ- and WRITE_ONCE 2020-07-16 08:16:34 +02:00
ixgbevf ixgbevf: Remove limit of 10 entries for unicast filter list 2020-02-05 21:22:44 +00:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile igc: Add skeletal frame for Intel(R) 2.5G Ethernet Controller support 2018-10-17 12:14:54 -07:00
e100.c intel: correct return from set features callback 2019-03-19 14:18:49 -07:00