diff mbox series

wifi: cfg80211: Avoid RCU debug splat in __cfg80211_bss_update error paths

Message ID 20240904015520.3571295-1-quic_vjakkam@quicinc.com
State New
Headers show
Series wifi: cfg80211: Avoid RCU debug splat in __cfg80211_bss_update error paths | expand

Commit Message

Veerendranath Jakkam Sept. 4, 2024, 1:55 a.m. UTC
Add rcu_read_lock() and rcu_read_unlock() to avoid suspicious
rcu_dereference_check warnings in __cfg80211_bss_update error paths.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
---
 net/wireless/scan.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Veerendranath Jakkam Sept. 4, 2024, 2:24 p.m. UTC | #1
On 9/4/2024 1:10 PM, Johannes Berg wrote:
>
> I don't think that's right. Every other path here just uses
> rcu_access_pointer(), and we own the 'tmp' at this point, so that seems
> correct.
>
> johannes


Thanks, sent v2 with the suggested changes.

- veeru
diff mbox series

Patch

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index d99319d82205..18f860ac14a7 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2008,12 +2008,14 @@  __cfg80211_bss_update(struct cfg80211_registered_device *rdev,
 	return found;
 
 free_ies:
+	rcu_read_lock();
 	ies = (void *)rcu_dereference(tmp->pub.beacon_ies);
 	if (ies)
 		kfree_rcu(ies, rcu_head);
 	ies = (void *)rcu_dereference(tmp->pub.proberesp_ies);
 	if (ies)
 		kfree_rcu(ies, rcu_head);
+	rcu_read_unlock();
 
 	return NULL;
 }