UPSTREAM: 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: 6cd536fe ("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> Bug: 204384349 (cherry picked from commit 09b1d5dc) Signed-off-by:
Veerendranath Jakkam <quic_vjakkam@quicinc.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@google.com> Change-Id: Id1bca68277be3a5f7c7329a8195018946f686bdb
Loading
Please sign in to comment