Commit e66e814d authored by Johannes Berg's avatar Johannes Berg Committed by Kleber Sacilotto de Souza

mac80211: fix mgmt-tx abort cookie and leak

BugLink: https://bugs.launchpad.net/bugs/1878232

commit e673a659 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: 3b79af97 ("mac80211: stop using pointers as userspace cookies")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 36f6e4b5
...@@ -308,11 +308,10 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free) ...@@ -308,11 +308,10 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free)
/* was never transmitted */ /* was never transmitted */
if (roc->frame) { if (roc->frame) {
cfg80211_mgmt_tx_status(&roc->sdata->wdev, cfg80211_mgmt_tx_status(&roc->sdata->wdev, roc->mgmt_tx_cookie,
(unsigned long)roc->frame,
roc->frame->data, roc->frame->len, roc->frame->data, roc->frame->len,
false, GFP_KERNEL); false, GFP_KERNEL);
kfree_skb(roc->frame); ieee80211_free_txskb(&roc->sdata->local->hw, roc->frame);
} }
if (!roc->mgmt_tx_cookie) if (!roc->mgmt_tx_cookie)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment