]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mac80211: fix locking in update_vlan_tailroom_need_count()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 17 Jun 2015 11:54:54 +0000 (13:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2015 16:49:29 +0000 (09:49 -0700)
commit80b856db9f9e1dbaf20a24020f8ade95c14f7477
tree4e3f89eefb42cefde99e310d630b47205aa39cee
parent914b0ef228c97dfea025091428f6c7809c9d38ad
mac80211: fix locking in update_vlan_tailroom_need_count()

[ Upstream commit 51f458d9612177f69c2e2c437034ae15f93078e7 ]

Unfortunately, Michal's change to fix AP_VLAN crypto tailroom
caused a locking issue that was reported by lockdep, but only
in a few cases - the issue was a classic ABBA deadlock caused
by taking the mtx after the key_mtx, where normally they're
taken the other way around.

As the key mutex protects the field in question (I'm adding a
few annotations to make that clear) only the iteration needs
to be protected, but we can also iterate the interface list
with just RCU protection while holding the key mutex.

Fixes: f9dca80b98ca ("mac80211: fix AP_VLAN crypto tailroom calculation")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/key.c