linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ping-Ke Shih <pkshih@realtek.com>
Subject: Re: [PATCH] rtw89: fix RCU usage in rtw89_core_txq_push()
Date: Mon, 21 Feb 2022 08:55:29 +0000 (UTC)	[thread overview]
Message-ID: <164543372747.995.16579003811495784285.kvalo@kernel.org> (raw)
In-Reply-To: <nycvar.YFH.7.76.2202152037000.11721@cbobk.fhfr.pm>

Jiri Kosina <jkosina@suse.cz> wrote:

> From: Jiri Kosina <jkosina@suse.cz>
> Subject: [PATCH] rtw89: fix RCU usage in rtw89_core_txq_push()
> 
> ieee80211_tx_h_select_key() is performing a series of RCU dereferences,
> but rtw89_core_txq_push() is calling it (via ieee80211_tx_dequeue_ni())
> without RCU read-side lock held; fix that.
> 
> This addresses the splat below.
> 
>  =============================
>  WARNING: suspicious RCU usage
>  5.17.0-rc4-00003-gccad664b7f14 #3 Tainted: G            E
>  -----------------------------
>  net/mac80211/tx.c:593 suspicious rcu_dereference_check() usage!
> 
>  other info that might help us debug this:
> 
>  rcu_scheduler_active = 2, debug_locks = 1
>  2 locks held by kworker/u33:0/184:
>   #0: ffff9c0b14811d38 ((wq_completion)rtw89_tx_wq){+.+.}-{0:0}, at: process_one_work+0x258/0x660
>   #1: ffffb97380cf3e78 ((work_completion)(&rtwdev->txq_work)){+.+.}-{0:0}, at: process_one_work+0x258/0x660
> 
>  stack backtrace:
>  CPU: 8 PID: 184 Comm: kworker/u33:0 Tainted: G            E     5.17.0-rc4-00003-gccad664b7f14 #3 473b49ab0e7c2d6af2900c756bfd04efd7a9de13
>  Hardware name: LENOVO 20UJS2B905/20UJS2B905, BIOS R1CET63W(1.32 ) 04/09/2021
>  Workqueue: rtw89_tx_wq rtw89_core_txq_work [rtw89_core]
>  Call Trace:
>   <TASK>
>   dump_stack_lvl+0x58/0x71
>   ieee80211_tx_h_select_key+0x2c0/0x530 [mac80211 911c23e2351c0ae60b597a67b1204a5ea955e365]
>   ieee80211_tx_dequeue+0x1a7/0x1260 [mac80211 911c23e2351c0ae60b597a67b1204a5ea955e365]
>   rtw89_core_txq_work+0x1a6/0x420 [rtw89_core b39ba493f2e517ad75e0f8187ecc24edf58bbbea]
>   process_one_work+0x2d8/0x660
>   worker_thread+0x39/0x3e0
>   ? process_one_work+0x660/0x660
>   kthread+0xe5/0x110
>   ? kthread_complete_and_exit+0x20/0x20
>   ret_from_fork+0x22/0x30
>   </TASK>
> 
>  =============================
>  WARNING: suspicious RCU usage
>  5.17.0-rc4-00003-gccad664b7f14 #3 Tainted: G            E
>  -----------------------------
>  net/mac80211/tx.c:607 suspicious rcu_dereference_check() usage!
> 
>  other info that might help us debug this:
> 
>  rcu_scheduler_active = 2, debug_locks = 1
>  2 locks held by kworker/u33:0/184:
>   #0: ffff9c0b14811d38 ((wq_completion)rtw89_tx_wq){+.+.}-{0:0}, at: process_one_work+0x258/0x660
>   #1: ffffb97380cf3e78 ((work_completion)(&rtwdev->txq_work)){+.+.}-{0:0}, at: process_one_work+0x258/0x660
> 
>  stack backtrace:
>  CPU: 8 PID: 184 Comm: kworker/u33:0 Tainted: G            E     5.17.0-rc4-00003-gccad664b7f14 #3 473b49ab0e7c2d6af2900c756bfd04efd7a9de13
>  Hardware name: LENOVO 20UJS2B905/20UJS2B905, BIOS R1CET63W(1.32 ) 04/09/2021
>  Workqueue: rtw89_tx_wq rtw89_core_txq_work [rtw89_core]
>  Call Trace:
>   <TASK>
>   dump_stack_lvl+0x58/0x71
>   ieee80211_tx_h_select_key+0x464/0x530 [mac80211 911c23e2351c0ae60b597a67b1204a5ea955e365]
>   ieee80211_tx_dequeue+0x1a7/0x1260 [mac80211 911c23e2351c0ae60b597a67b1204a5ea955e365]
>   rtw89_core_txq_work+0x1a6/0x420 [rtw89_core b39ba493f2e517ad75e0f8187ecc24edf58bbbea]
>   process_one_work+0x2d8/0x660
>   worker_thread+0x39/0x3e0
>   ? process_one_work+0x660/0x660
>   kthread+0xe5/0x110
>   ? kthread_complete_and_exit+0x20/0x20
>   ret_from_fork+0x22/0x30
>   </TASK>
> 
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

f3d825a35920 rtw89: fix RCU usage in rtw89_core_txq_push()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/nycvar.YFH.7.76.2202152037000.11721@cbobk.fhfr.pm/

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


      parent reply	other threads:[~2022-02-21  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 19:37 [PATCH] rtw89: fix RCU usage in rtw89_core_txq_push() Jiri Kosina
2022-02-16  0:27 ` Pkshih
2022-02-21  8:55 ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164543372747.995.16579003811495784285.kvalo@kernel.org \
    --to=kvalo@kernel.org \
    --cc=jkosina@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).