Page MenuHomeFreeBSD

net80211: remove node scan lock / generation number + fix few LORs
ClosedPublic

Authored by avos on Jun 13 2016, 2:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 8:02 AM
Unknown Object (File)
Thu, Apr 25, 10:45 PM
Unknown Object (File)
Jan 29 2024, 7:48 PM
Unknown Object (File)
Jan 17 2024, 10:19 AM
Unknown Object (File)
Dec 25 2023, 6:38 AM
Unknown Object (File)
Dec 19 2023, 11:40 PM
Unknown Object (File)
Dec 15 2023, 3:12 PM
Unknown Object (File)
Dec 9 2023, 3:35 PM
Subscribers

Details

Summary

Drop scan generation number and node table scan lock - the only place where ni_scangen is checked is in ieee80211_timeout_stations() (and it is used to prevent duplicate checking of the same node); node scan lock protects only this variable + node table scan generation number.

This will fix (at least) next LOR (hostap mode):
lock order reversal:
1st 0xc175f84c urtwm0_scan_loc (urtwm0_scan_loc) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2019
2nd 0xc175e018 urtwm0_com_lock (urtwm0_com_lock) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2693
stack backtrace:
#0 0xa070d1c5 at witness_debugger+0x75
#1 0xa070d0f6 at witness_checkorder+0xd46
#2 0xa0694cce at __mtx_lock_flags+0x9e
#3 0xb03ad9ef at ieee80211_node_leave+0x12f
#4 0xb03afd13 at ieee80211_timeout_stations+0x483
#5 0xb03aa1c2 at ieee80211_node_timeout+0x42
#6 0xa06c6fa1 at softclock_call_cc+0x1e1
#7 0xa06c7518 at softclock+0xc8
#8 0xa06789ae at intr_event_execute_handlers+0x8e
#9 0xa0678fa0 at ithread_loop+0x90
#10 0xa0675fbe at fork_exit+0x7e
#11 0xa08af910 at fork_trampoline+0x8

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avos retitled this revision from to net80211: replace node scan lock / generation number by flag.
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos added a reviewer: adrian.
avos set the repository for this revision to rS FreeBSD src repository - subversion.
avos retitled this revision from net80211: replace node scan lock / generation number by flag to net80211: remove node scan lock / generation number + fix few LORs.
avos updated this object.

In addition to the above:

  • switch to ieee80211_iterate_nodes();
  • do not assert that node table lock is held, while calling node_age(); that's not really needed (there are no resources, which can be protected by this lock) + this fixes LOR/deadlock between ieee80211_timeout_stations() and ieee80211_set_tim() (easy to reproduce in HOSTAP mode while sending something to an STA with enabled power management).
This revision was automatically updated to reflect the committed changes.