]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: wfx: fix potential use-after-free
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Fri, 15 May 2020 08:33:16 +0000 (10:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2020 14:00:52 +0000 (16:00 +0200)
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>
drivers/staging/wfx/data_tx.c

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