linux/drivers/net/ethernet/intel
Stefan Assmann a7542b8760 i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask
While testing VF spawn/destroy the following panic occurred.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000029
[...]
Workqueue: i40e i40e_service_task [i40e]
RIP: 0010:i40e_sync_vsi_filters+0x6fd/0xc60 [i40e]
[...]
Call Trace:
 ? __switch_to_asm+0x35/0x70
 ? __switch_to_asm+0x41/0x70
 ? __switch_to_asm+0x35/0x70
 ? _cond_resched+0x15/0x30
 i40e_sync_filters_subtask+0x56/0x70 [i40e]
 i40e_service_task+0x382/0x11b0 [i40e]
 ? __switch_to_asm+0x41/0x70
 ? __switch_to_asm+0x41/0x70
 process_one_work+0x1a7/0x3b0
 worker_thread+0x30/0x390
 ? create_worker+0x1a0/0x1a0
 kthread+0x112/0x130
 ? kthread_bind+0x30/0x30
 ret_from_fork+0x35/0x40

Investigation revealed a race where pf->vf[vsi->vf_id].trusted may get
accessed by the watchdog via i40e_sync_filters_subtask() although
i40e_free_vfs() already free'd pf->vf.
To avoid this the call to i40e_sync_vsi_filters() in
i40e_sync_filters_subtask() needs to be guarded by __I40E_VF_DISABLE,
which is also used by i40e_free_vfs().

Note: put the __I40E_VF_DISABLE check after the
__I40E_MACVLAN_SYNC_PENDING check as the latter is more likely to
trigger.

CC: stable@vger.kernel.org
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-09-11 09:10:45 -07:00
..
e1000 ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
e1000e e1000e: Make speed detection on hotplugging cable more reliable 2019-09-09 10:08:38 -07:00
fm10k fm10k: use a local variable for the frag pointer 2019-09-09 10:08:38 -07:00
i40e i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask 2019-09-11 09:10:45 -07:00
iavf iavf: allow permanent MAC address to change 2019-09-09 10:08:38 -07:00
ice ice: Rework around device/function capabilities 2019-09-05 08:13:41 -07:00
igb ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:04 -07:00
igbvf net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
igc igc: Add tx_csum offload functionality 2019-09-09 11:37:14 -07:00
ixgb net: Use skb accessors in network drivers 2019-07-22 20:47:56 -07:00
ixgbe ixgbe: fix memory leaks 2019-09-11 09:10:45 -07:00
ixgbevf ixgbevf: Link lost in VM on ixgbevf when restoring from freeze or suspend 2019-09-09 10:08:38 -07:00
e100.c intel: correct return from set features callback 2019-03-19 14:18:49 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile