Subject: Re: [PATCH] ath10k: Fix suspicious RCU usage warning in ath10k_wmi_tlv_parse_peer_stats_info()

From: Kalle Valo <[email-masked]>
Date: Tue, 9 Feb 2021 07:17:41 +0000 (UTC)

Anand K Mistry <[email-masked]> wrote:

> The ieee80211_find_sta_by_ifaddr call in
> ath10k_wmi_tlv_parse_peer_stats_info must be called while holding the
> RCU read lock. Otherwise, the following warning will be seen when RCU
> usage checking is enabled:
> 
> =============================
> WARNING: suspicious RCU usage
> 5.10.3 #8 Tainted: G        W
> -----------------------------
> include/linux/rhashtable.h:594 suspicious rcu_dereference_check() usage!
> 
> other info that might help us debug this:
> 
> rcu_scheduler_active = 2, debug_locks = 1
> no locks held by ksoftirqd/1/16.
> 
> stack backtrace:
> CPU: 1 PID: 16 Comm: ksoftirqd/1 Tainted: G        W         5.10.3 #8
> Hardware name: HP Grunt/Grunt, BIOS Google_Grunt.11031.104.0 09/05/2019
> Call Trace:
>  dump_stack+0xab/0x115
>  sta_info_hash_lookup+0x71/0x1e9 [mac80211]
>  ? lock_is_held_type+0xe6/0x12f
>  ? __kasan_kmalloc+0xfb/0x112
>  ieee80211_find_sta_by_ifaddr+0x12/0x61 [mac80211]
>  ath10k_wmi_tlv_parse_peer_stats_info+0xbd/0x10b [ath10k_core]
>  ath10k_wmi_tlv_iter+0x8b/0x1a1 [ath10k_core]
>  ? ath10k_wmi_tlv_iter+0x1a1/0x1a1 [ath10k_core]
>  ath10k_wmi_tlv_event_peer_stats_info+0x103/0x13b [ath10k_core]
>  ath10k_wmi_tlv_op_rx+0x722/0x80d [ath10k_core]
>  ath10k_htc_rx_completion_handler+0x16e/0x1d7 [ath10k_core]
>  ath10k_pci_process_rx_cb+0x116/0x22c [ath10k_pci]
>  ? ath10k_htc_process_trailer+0x332/0x332 [ath10k_core]
>  ? _raw_spin_unlock_irqrestore+0x34/0x61
>  ? lockdep_hardirqs_on+0x8e/0x12e
>  ath10k_ce_per_engine_service+0x55/0x74 [ath10k_core]
>  ath10k_ce_per_engine_service_any+0x76/0x84 [ath10k_core]
>  ath10k_pci_napi_poll+0x49/0x141 [ath10k_pci]
>  net_rx_action+0x11a/0x347
>  __do_softirq+0x2d3/0x539
>  run_ksoftirqd+0x4b/0x86
>  smpboot_thread_fn+0x1d0/0x2ab
>  ? cpu_report_death+0x7f/0x7f
>  kthread+0x189/0x191
>  ? cpu_report_death+0x7f/0x7f
>  ? kthread_blkcg+0x31/0x31
>  ret_from_fork+0x22/0x30
> 
> Fixes: 0f7cb26830a6e ("ath10k: add rx bitrate report for SDIO")
> Signed-off-by: Anand K Mistry <[email-masked]>
> Signed-off-by: Kalle Valo <[email-masked]>

Patch applied to ath-next branch of ath.git, thanks.

2615e3cdbd9c ath10k: Fix suspicious RCU usage warning in ath10k_wmi_tlv_parse_peer_stats_info()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210202134451.1.I0d2e83c42755671b7143504b62787fd06cd914ed@changeid/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches