]> git.itanic.dy.fi Git - linux-stable/commit
nl80211: fix dumpit error path RTNL deadlocks
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Mar 2017 13:26:04 +0000 (14:26 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 7 Apr 2017 08:38:27 +0000 (10:38 +0200)
commita7756258a9f602ee99bf2b329f1010864770dd23
tree52895b3d56a4be33c62d0152e9988bc1c6b402cb
parent597590a08a087c2d795a840283203c4a431ea080
nl80211: fix dumpit error path RTNL deadlocks

commit ea90e0dc8cecba6359b481e24d9c37160f6f524f upstream.

Sowmini pointed out Dmitry's RTNL deadlock report to me, and it turns out
to be perfectly accurate - there are various error paths that miss unlock
of the RTNL.

To fix those, change the locking a bit to not be conditional in all those
nl80211_prepare_*_dump() functions, but make those require the RTNL to
start with, and fix the buggy error paths. This also let me use sparse
(by appropriately overriding the rtnl_lock/rtnl_unlock functions) to
validate the changes.

[js] no mpp and vendor dumps in 3.12 yet

Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/wireless/nl80211.c