Commit a7d87a08 authored by Johannes Berg's avatar Johannes Berg Committed by Greg Kroah-Hartman
Browse files

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: default avatarJouni 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: default avatarJohannes Berg <johannes.berg@intel.com>

Bug: 204384349
(cherry picked from commit 09b1d5dc)
Signed-off-by: default avatarVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: Id1bca68277be3a5f7c7329a8195018946f686bdb
parent dd78ccad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment