aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYueHaibing <[email protected]>2022-11-23 16:12:53 +0800
committerGreg Kroah-Hartman <[email protected]>2022-12-05 13:26:08 +0100
commitd30f4436f364b4ad915ca2c09be07cd0f93ceb44 (patch)
tree8a274fde0ce3b72fc7752036f10cc897db5a7105
parente0005909e5e98f230397064de391371ba6a66fba (diff)
staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it, after calling this, dereferencing skb may trigger use-after-free. Found by Smatch. Fixes: 94a799425eee ("From: wlanfae <[email protected]> [PATCH 1/8] rtl8192e: Import new version of driver from realtek") Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/rtl8192e/rtllib_rx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 6a0f5bbb99ef..f8965afab767 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1489,9 +1489,9 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb,
hdrlen += 4;
}
- rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
ieee->stats.rx_packets++;
ieee->stats.rx_bytes += skb->len;
+ rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
return 1;
}