]> git.baikalelectronics.ru Git - kernel.git/commit
cfg80211: fix management registrations locking
authorJohannes Berg <johannes.berg@intel.com>
Mon, 25 Oct 2021 11:31:12 +0000 (13:31 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Oct 2021 13:20:22 +0000 (15:20 +0200)
commit58cad1955b60e32e52b41b79e12a24556ed0f0c1
tree081ea94c34d6fd411e495d3139fcef8efe3a9b5e
parent3fcf2d40ff1afaacebf86b46a8152dd6252e6d76
cfg80211: fix management registrations locking

The management registrations locking was broken, the list was
locked for each wdev, but cfg80211_mgmt_registrations_update()
iterated it without holding all the correct spinlocks, causing
list corruption.

Rather than trying to fix it with fine-grained locking, just
move the lock to the wiphy/rdev (still need the list on each
wdev), we already need to hold the wdev lock to change it, so
there's no contention on the lock in any case. This trivially
fixes the bug since we hold one wdev's lock already, and now
will hold the lock that protects all lists.

Cc: stable@vger.kernel.org
Reported-by: Jouni Malinen <j@w1.fi>
Fixes: ec2029ea7a5e ("cfg80211: change internal management frame registration API")
Link: https://lore.kernel.org/r/20211025133111.5cf733eab0f4.I7b0abb0494ab712f74e2efcd24bb31ac33f7eee9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/wireless/core.c
net/wireless/core.h
net/wireless/mlme.c