From: Johannes Berg <johannes@sipsolutions.net>
To: Max Schulze <max.schulze@online.de>, linux-wireless@vger.kernel.org
Subject: Re: [RFC PATCH] wifi: cfg80211: fix cqm_config access race
Date: Tue, 15 Aug 2023 13:02:15 +0200 [thread overview]
Message-ID: <5864e873e7a81088ecfeb3af3c6bfc27be90adca.camel@sipsolutions.net> (raw)
In-Reply-To: <3857b8d4-ba9d-7544-98c3-876b80a69bb4@online.de>
On Tue, 2023-08-15 at 12:56 +0200, Max Schulze wrote:
> Hello Johannes,
>
> thanks for your patch.
>
> While it works well in my lab setting, it crashes within minutes in the field.
>
> While the crashes look slightly different ("Unable to handle kernel pagign request"... descendant of is_swiotlb_active...) I think the notice beforehand is much more interesting: do you understand it?
>
> : ------------[ cut here ]------------
> : Voluntary context switch within RCU read-side critical section!
[...]
> : brcmf_sdio_bus_txctl+0xcc/0x1f4 [brcmfmac]
> : brcmf_proto_bcdc_msg+0xd4/0xf0 [brcmfmac]
> : brcmf_proto_bcdc_set_dcmd+0x88/0x124 [brcmfmac]
> : brcmf_fil_cmd_data+0x84/0x180 [brcmfmac]
> : brcmf_fil_iovar_data_set+0x11c/0x160 [brcmfmac]
> : brcmf_cfg80211_set_cqm_rssi_range_config+0xe4/0x130 [brcmfmac]
> : cfg80211_cqm_rssi_update+0x120/0x3f0 [cfg80211]
> : cfg80211_cqm_rssi_notify+0x78/0x1b4 [cfg80211]
[...]
Oh, yeah, stupid me.
I did RCU protection around cfg80211_cqm_rssi_update() to have that
protected, but failed to realize that this will call back into the
driver too, which then promptly assumes it can sleep.
Well, OK, so this isn't how we can fix this.
That's really bad for multiple reasons though, because it also means we
call back into the driver from a driver call, which is generally not a
good idea since it can easily cause deadlocks.
Anyway, I guess I have to come up with something else. Thanks for
testing, and sorry I didn't realize that before.
johannes
next prev parent reply other threads:[~2023-08-15 11:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 14:11 BCM43455: brcmf_notify_rssi / cfg80211_cqm_rssi_notify : Unable to handle kernel NULL pointer dereference Max Schulze
2023-08-10 8:34 ` BCM43455: brcmf_notify_rssi / cfg80211_cqm_rssi_notify : Unable to handle kernel NULL pointer dereference (RSSI notification after station disconnect?) Max Schulze
2023-08-11 7:30 ` [PATCH] wifi: nl80211: avoid NULL-ptr deref after cfg80211_cqm_rssi_update Max Schulze
2023-08-11 9:54 ` Johannes Berg
2023-08-12 9:35 ` Max Schulze
2023-08-12 9:23 ` BCM43455: brcmf_notify_rssi / cfg80211_cqm_rssi_notify : Unable to handle kernel NULL pointer dereference (RSSI notification after station disconnect?) Max Schulze
2023-08-13 13:18 ` [RFC PATCH] wifi: cfg80211: fix cqm_config access race Johannes Berg
2023-08-15 10:56 ` Max Schulze
2023-08-15 11:02 ` Johannes Berg [this message]
2023-08-15 11:42 ` [RFC PATCH v2] " Johannes Berg
2023-08-15 13:24 ` Max Schulze
2023-08-15 13:25 ` Johannes Berg
2023-08-15 13:37 ` [RFC PATCH v2 6.1] " Johannes Berg
2023-08-16 7:23 ` Max Schulze
2023-08-16 7:30 ` Johannes Berg
2023-08-16 11:24 ` Max Schulze
2023-08-16 13:08 ` Max Schulze
2023-08-16 13:17 ` Johannes Berg
2023-08-16 13:33 ` Max Schulze
2023-08-16 13:27 ` Johannes Berg
2023-08-16 13:32 ` [RFC PATCH v3 " Johannes Berg
2023-08-16 13:36 ` Johannes Berg
2023-08-16 13:38 ` [RFC PATCH v4 " Johannes Berg
2023-09-11 13:16 ` Max Schulze
2023-09-11 16:23 ` Max Schulze
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=5864e873e7a81088ecfeb3af3c6bfc27be90adca.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=max.schulze@online.de \
/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