staging: wfx: fix potential use-after-free

wfx_tx_policy_put() use data from the skb. However, the call to
skb_pull() has just discarded them (even if the memory is in fact not
really discarded).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200515083325.378539-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jérôme Pouiller 2020-05-15 10:33:16 +02:00 committed by Greg Kroah-Hartman
parent ad83396891
commit 13839ef377
1 changed files with 1 additions and 1 deletions

View File

@ -494,8 +494,8 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
req->data_flags.fc_offset; req->data_flags.fc_offset;
WARN_ON(!wvif); WARN_ON(!wvif);
skb_pull(skb, offset);
wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index);
skb_pull(skb, offset);
ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb); ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb);
} }