Patch "wifi: mwifiex: avoid possible NULL skb pointer dereference" has been added to the 5.15-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

    wifi: mwifiex: avoid possible NULL skb pointer dereference

to the 5.15-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:
     wifi-mwifiex-avoid-possible-null-skb-pointer-derefer.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 11f6374d8b1d14fffbb8e86ea99172ccf6b1b83c
Author: Dmitry Antipov <dmantipov@xxxxxxxxx>
Date:   Mon Aug 14 12:49:57 2023 +0300

    wifi: mwifiex: avoid possible NULL skb pointer dereference
    
    [ Upstream commit 35a7a1ce7c7d61664ee54f5239a1f120ab95a87e ]
    
    In 'mwifiex_handle_uap_rx_forward()', always check the value
    returned by 'skb_copy()' to avoid potential NULL pointer
    dereference in 'mwifiex_uap_queue_bridged_pkt()', and drop
    original skb in case of copying failure.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 838e4f449297 ("mwifiex: improve uAP RX handling")
    Acked-by: Brian Norris <briannorris@xxxxxxxxxxxx>
    Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230814095041.16416-1-dmantipov@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
index d6493638e7028..8a5d0125a1abd 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
@@ -265,7 +265,15 @@ int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
 
 	if (is_multicast_ether_addr(ra)) {
 		skb_uap = skb_copy(skb, GFP_ATOMIC);
-		mwifiex_uap_queue_bridged_pkt(priv, skb_uap);
+		if (likely(skb_uap)) {
+			mwifiex_uap_queue_bridged_pkt(priv, skb_uap);
+		} else {
+			mwifiex_dbg(adapter, ERROR,
+				    "failed to copy skb for uAP\n");
+			priv->stats.rx_dropped++;
+			dev_kfree_skb_any(skb);
+			return -1;
+		}
 	} else {
 		if (mwifiex_get_sta_entry(priv, ra)) {
 			/* Requeue Intra-BSS packet */



[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