diff options
author | Sara Sharon <sara.sharon@intel.com> | 2018-12-15 11:03:10 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-12-18 13:03:32 +0100 |
commit | a50e5fb8db83c5b57392204c21ea6c5c4ccefde6 (patch) | |
tree | cbffbae9790f918f7ac323268a6e1148488670a9 /net/mac80211/iface.c | |
parent | a5f3932646a74e690ed532a1f421f75c3b8cf1ec (diff) | |
download | linux-stable-a50e5fb8db83c5b57392204c21ea6c5c4ccefde6.tar.gz linux-stable-a50e5fb8db83c5b57392204c21ea6c5c4ccefde6.tar.bz2 linux-stable-a50e5fb8db83c5b57392204c21ea6c5c4ccefde6.zip |
mac80211: fix a kernel panic when TXing after TXQ teardown
Recently TXQ teardown was moved earlier in ieee80211_unregister_hw(),
to avoid a use-after-free of the netdev data. However, interfaces
aren't fully removed at the point, and cfg80211_shutdown_all_interfaces
can for example, TX a deauth frame. Move the TXQ teardown to the
point between cfg80211_shutdown_all_interfaces and the free of
netdev queues, so we can be sure they are torn down before netdev
is freed, but after there is no ongoing TX.
Fixes: 77cfaf52eca5 ("mac80211: Run TXQ teardown code before de-registering interfaces")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5f3c81e705c7..3a0171a65db3 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -7,6 +7,7 @@ * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (c) 2016 Intel Deutschland GmbH + * Copyright (C) 2018 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -1951,6 +1952,8 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) WARN(local->open_count, "%s: open count remains %d\n", wiphy_name(local->hw.wiphy), local->open_count); + ieee80211_txq_teardown_flows(local); + mutex_lock(&local->iflist_mtx); list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { list_del(&sdata->list); |