bes2600_join_work calls ieee80211_bss_get_elem without rcu_read_lock — suspicious RCU usage at net/wireless/util.c:1078 #23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
With
CONFIG_PROVE_LOCKING=y+CONFIG_LOCKDEP=y+CONFIG_DEBUG_LOCK_ALLOC=yenabled,bes2600_join_worktriggers aWARNING: suspicious RCU usageearly in boot (~t=43s on ohm) the first time it tries to look up the joining BSS:Root cause
ieee80211_bss_get_elem()is an RCU-protected accessor — it does anrcu_dereference()internally and expects the caller to hold eitherrcu_read_lock()or another suitable RCU read-side critical section.bes2600_join_workcalls it atbes2600_join_work+0xf0without first takingrcu_read_lock(), so PROVE_LOCKING'srcu_dereference_check()flags it.Source:
bes2600/sta.c— look for theieee80211_bss_get_elem(bss, ...)call site insidebes2600_join_work(likely around the SSID/IE extraction from thecfg80211_bss *that mac80211 passed in).Provenance
Pre-exists the besser patch stack —
bes2600_join_workis upstream c5x code, not added by any of the besser fixes (Patches A–H, c5.1–c7, etc.). Only surfaced now because Phase 7 of besser#18 ran with PROVE_LOCKING enabled, which is normally off in production builds.Fix
Wrap the
ieee80211_bss_get_elem()call (and the subsequent dereference of its returned pointer) inrcu_read_lock()/rcu_read_unlock(). Inspect the surrounding code to confirm the returned IE is either copied out before unlock or properly handled — the IE pointer is RCU-protected, so anything we do with it must live inside the read-side critical section.Pattern from cw1200 upstream (which has the same lookup) should be a clean reference. Per
feedback_mine_upstream_ancestor, checkdrivers/net/wireless/st/cw1200/sta.cin mainline first.Severity
Low runtime impact in production (kernels without PROVE_LOCKING just dereference without the check), but a real correctness bug — the bss IE table can be updated under RCU and a non-protected reader can see partial state. Worth fixing for both lockdep cleanliness and actual correctness.
Repro
linux-pinetab2-danctnix-besserwithCONFIG_PROVE_LOCKING=y+CONFIG_LOCKDEP=y+CONFIG_DEBUG_LOCK_ALLOC=y(i.e. the lockdep sibling kernel used for besser#18 Phase 7).sudo dmesg | grep -B1 -A30 'WARNING: suspicious RCU usage'will show the splat within ~30s of wlan0 coming up.Observed 2026-05-20 on ohm uname
7.0.0-danctnix1-5-pinetab2-danctnix-besser-lockdep.