ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()
authorShuah Khan <skhan@linuxfoundation.org>
Wed, 10 Feb 2021 21:21:07 +0000 (14:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 13:00:08 +0000 (15:00 +0200)
commit7d3ffc0993fed0ce5673453a12f72b8e335a88b5
treedb2bfd14736672404181533e67c8fd48f8275aa2
parent221528c20e5ebc5bccc94d11ec95aa86ea1c4598
ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

[ Upstream commit 09078368d516918666a0122f2533dc73676d3d7e ]

ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and
the resulting pointer is only valid under RCU lock as well.

Fix ath10k_wmi_tlv_op_pull_peer_stats_info() to hold RCU lock before it
calls ieee80211_find_sta_by_ifaddr() and release it when the resulting
pointer is no longer needed.

This problem was found while reviewing code to debug RCU warn from
ath10k_wmi_tlv_parse_peer_stats_info().

Link: https://lore.kernel.org/linux-wireless/7230c9e5-2632-b77e-c4f9-10eca557a5bb@linuxfoundation.org/
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210210212107.40373-1-skhan@linuxfoundation.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/wmi-tlv.c