Patch "staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     staging-rtl8192e-fix-potential-use-after-free-in-rtl.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e3c0f28b085d885febfa0e1c6b6151ca285bac0d
Author: YueHaibing <yuehaibing@xxxxxxxxxx>
Date:   Wed Nov 23 16:12:53 2022 +0800

    staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
    
    [ Upstream commit d30f4436f364b4ad915ca2c09be07cd0f93ceb44 ]
    
    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 <wlanfae@xxxxxxxxxxx> [PATCH 1/8] rtl8192e: Import new version of driver from realtek")
    Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221123081253.22296-1-yuehaibing@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 171009e82137..85a71b09fcba 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1501,9 +1501,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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux