mac80211: Run TXQ teardown code before de-registering interfaces
authorToke Høiland-Jørgensen <toke@toke.dk>
Mon, 13 Aug 2018 12:16:25 +0000 (14:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:54:18 +0000 (08:54 +0200)
commit4ae9a73be7ac5805a841a6da2bc792c046936c1c
tree309dbe8d9d21396602ef483a1fb7a36385dd4877
parent3a738e7f734ce0308377fbed37683bf355f0c12f
mac80211: Run TXQ teardown code before de-registering interfaces

[ Upstream commit 77cfaf52eca5cac30ed029507e0cab065f888995 ]

The TXQ teardown code can reference the vif data structures that are
stored in the netdev private memory area if there are still packets on
the queue when it is being freed. Since the TXQ teardown code is run
after the netdevs are freed, this can lead to a use-after-free. Fix this
by moving the TXQ teardown code to earlier in ieee80211_unregister_hw().

Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/main.c