From: Johannes Berg Date: Tue, 24 Nov 2015 19:28:27 +0000 (+0100) Subject: mac80211: fix mgmt-tx abort cookie and leak X-Git-Tag: v4.5-rc1~128^2~189^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e673a65952b4ab045a3e3eb200fdf408004fb4fd;p=platform%2Fkernel%2Flinux-exynos.git mac80211: fix mgmt-tx abort cookie and leak 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 --- diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 0440103..0fe9f74 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)