summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-11-24 20:28:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:26:04 +0200
commit85192dbafcadfa4631d2388a93173f57d6db82cf (patch)
tree3bfaaaf23e043ef475d36f9c34d41e4c1bae5ccc /net/mac80211
parentbe9113b305e2b9a91fa6e9b47f1df29eef255fb0 (diff)
mac80211: fix mgmt-tx abort cookie and leak
commit e673a65952b4ab045a3e3eb200fdf408004fb4fd upstream. If a mgmt-tx operation is aborted before it runs, the wrong cookie is reported back to userspace, and the ack_skb gets leaked since the frame is freed directly instead of freeing it using ieee80211_free_txskb(). Fix that. Fixes: 3b79af973cf4 ("mac80211: stop using pointers as userspace cookies") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/offchannel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index b6be51940ead..af489405d5b3 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -308,11 +308,10 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free)
/* was never transmitted */
if (roc->frame) {
- cfg80211_mgmt_tx_status(&roc->sdata->wdev,
- (unsigned long)roc->frame,
+ cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie,
roc->frame->data, roc->frame->len,
false, GFP_KERNEL);
- kfree_skb(roc->frame);
+ ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
}
if (!roc->mgmt_tx_cookie)