mirror_ubuntu-kernels/drivers/net/wireless/intel/iwlwifi/mvm
Sara Sharon efa40c7ef6 iwlwifi: mvm: fix suspicious rcu usage warnings
mvm mutex isn't held by iwl_mvm_set_aes_rx_seq or it caller.
iee80211_local->key_mtx is held, but that is internal to mac80211.

The same applies to iwl_mvm_wowlan_program_keys.

Just hold rcu_read_lock, even though we are protected, the penalty
isn't that bad.

Warnings fixed are:

[ 4143.788196] WARNING: suspicious RCU usage
[ 4143.788211] -----------------------------
[ 4143.788220] suspicious rcu_dereference_protected() usage!
[ 4143.788227]
[ 4143.788234] rcu_scheduler_active = 2, debug_locks = 1
[ 4143.788242] 5 locks held by kworker/u8:9/5921:
[ 4143.788331]  #4: ffff88804e69ad08 (&local->key_mtx){+.+.}, at ie80211_iter_keys+0x46/0x380 [mac80211]
[ 4143.788441]
[ 4143.788441] Call Trace:
[ 4143.788455]  dump_stack+0xc1/0x11a
[ 4143.788471]  lockdep_rcu_suspicious+0x14a/0x153
[ 4143.788515]  iwl_mvm_set_aes_rx_seq+0x4a9/0x570 [iwlmvm]
[ 4143.788657]  iwl_mvm_d3_update_keys+0x2ac/0x600 [iwlmvm]
[ 4143.788784]  ieee80211_iter_keys+0x10e/0x380 [mac80211]
[ 4143.788838]  iwl_mvm_setup_connection_keep+0x287/0x8d0 [iwlmvm]

[ 7243.206556] WARNING: suspicious RCU usage
[ 7243.206811] -----------------------------
[ 7243.206926] /suspicious rcu_dereference_protected() usage!
[ 7243.207086]
[ 7243.207204] rcu_scheduler_active = 2, debug_locks = 1
[ 7243.207321] 2 locks held by cat/15952:
[ 7243.207564]  #1: ffff888008c8ad08 (&local->key_mtx){+.+.}, at:
ieee80211_iter_keys+0x46/0x380 [mac80211]
[ 7243.207751]
[ 7243.208094] Call Trace:
[ 7243.208211]  dump_stack+0xc1/0x11a
[ 7243.208355]  lockdep_rcu_suspicious+0x14a/0x153
[ 7243.208509]  iwl_mvm_wowlan_program_keys+0x1db7/0x2340 [iwlmvm]
[ 7243.209852]  ieee80211_iter_keys+0x10e/0x380 [mac80211]

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008181047.65872d5f1670.I0b2fb2a65904ae686c3c7c05f881a1e3634dc900@changeid
2020-10-08 20:14:53 +03:00
..
binding.c iwlwifi: mvm: add a get lmac id function 2020-10-08 20:09:36 +03:00
coex.c iwlwifi: mvm: stop supporting swcrypto and bt_coex_active module parameters 2020-05-08 09:50:52 +03:00
constants.h iwlwifi: mvm: Add FTM initiator RTT smoothing logic 2020-10-01 22:00:55 +03:00
d3.c iwlwifi: mvm: fix suspicious rcu usage warnings 2020-10-08 20:14:53 +03:00
debugfs-vif.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-05-02 22:14:21 -04:00
debugfs.c iwlwifi: mvm: get number of stations from TLV 2020-10-08 20:09:25 +03:00
debugfs.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
ftm-initiator.c iwlwifi: mvm: initiator: add option for adding a PASN responder 2020-10-01 22:00:57 +03:00
ftm-responder.c iwlwifi: mvm: avoid possible NULL pointer dereference 2020-10-08 20:09:39 +03:00
fw-api.h iwlwifi: mvm: add soc latency support 2020-03-27 08:12:46 +02:00
fw.c iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12 2020-10-08 20:09:37 +03:00
led.c iwlwifi: check kasprintf() return value 2019-11-20 12:28:56 +02:00
mac80211.c iwlwifi: mvm: don't send a CSA command the firmware doesn't know 2020-10-08 20:14:50 +03:00
mac-ctxt.c iwlwifi: mvm: re-enable TX after channel switch 2020-10-08 20:09:33 +03:00
Makefile iwlwifi: mvm: support FTM initiator 2019-02-14 11:29:43 +02:00
mvm.h iwlwifi: mvm: prepare roc_done_wk to work sync 2020-10-08 20:09:35 +03:00
nvm.c iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices 2020-02-13 12:02:54 +02:00
offloading.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
ops.c iwlwifi: mvm: get number of stations from TLV 2020-10-08 20:09:25 +03:00
phy-ctxt.c iwlwifi: mvm: add a get lmac id function 2020-10-08 20:09:36 +03:00
power.c iwlwifi: mvm: update powersave correctly for D3 2019-12-20 14:23:24 +02:00
quota.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
rs-fw.c iwlwifi: mvm: rs-fw: handle VHT extended NSS capability 2020-10-01 21:52:51 +03:00
rs.c iwlwifi: rs: set RTS protection for all non legacy rates 2020-10-01 21:59:36 +03:00
rs.h iwlwifi: mvm: in VHT connection use only VHT capabilities 2019-11-15 09:31:56 +02:00
rx.c iwlwifi: mvm: get number of stations from TLV 2020-10-08 20:09:25 +03:00
rxmq.c iwlwifi: mvm: get number of stations from TLV 2020-10-08 20:09:25 +03:00
scan.c iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12 2020-10-08 20:09:37 +03:00
sf.c iwlwifi: mvm: enable SF also when we have HE 2020-03-27 08:12:48 +02:00
sta.c iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12 2020-10-08 20:09:37 +03:00
sta.h iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12 2020-10-08 20:09:37 +03:00
tdls.c iwlwifi: mvm: get number of stations from TLV 2020-10-08 20:09:25 +03:00
testmode.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
time-event.c iwlwifi: mvm: don't send a CSA command the firmware doesn't know 2020-10-08 20:14:50 +03:00
time-event.h iwlwifi: mvm: don't send a CSA command the firmware doesn't know 2020-10-08 20:14:50 +03:00
tt.c iwlwifi: mvm: prepare roc_done_wk to work sync 2020-10-08 20:09:35 +03:00
tx.c iwlwifi: mvm: add a get lmac id function 2020-10-08 20:09:36 +03:00
utils.c iwlwifi: mvm: utils: Fix some doc-rot 2020-10-08 13:43:46 +03:00