Skip to content
Commit 8ed4b5d7 authored by Stefan Assmann's avatar Stefan Assmann Committed by Greg Kroah-Hartman
Browse files

i40e: improve locking of mac_filter_hash

[ Upstream commit 8b4b0691 ]

i40e_config_vf_promiscuous_mode() calls
i40e_getnum_vf_vsi_vlan_filters() without acquiring the
mac_filter_hash_lock spinlock.

This is unsafe because mac_filter_hash may get altered in another thread
while i40e_getnum_vf_vsi_vlan_filters() traverses the hashes.

Simply adding the spinlock in i40e_getnum_vf_vsi_vlan_filters() is not
possible as it already gets called in i40e_get_vlan_list_sync() with the
spinlock held. Therefore adding a wrapper that acquires the spinlock and
call the correct function where appropriate.

Fixes: 37d318d7

 ("i40e: Remove scheduling while atomic possibility")
Fix-suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarStefan Assmann <sassmann@kpanic.de>
Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 30055e02
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment