Patch "ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso" has been added to the 5.11-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

    ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso

to the 5.11-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:
     ethernet-myri10ge-fix-a-use-after-free-in-myri10ge_s.patch
and it can be found in the queue-5.11 subdirectory.

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



commit 03862dd9073032c294b922587baad8c9ad555efe
Author: Lv Yunlong <lyl2019@xxxxxxxxxxxxxxxx>
Date:   Mon Mar 29 05:36:48 2021 -0700

    ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso
    
    [ Upstream commit 63415767a2446136372e777cde5bb351f21ec21d ]
    
    In myri10ge_sw_tso, the skb_list_walk_safe macro will set
    (curr) = (segs) and (next) = (curr)->next. If status!=0 is true,
    the memory pointed by curr and segs will be free by dev_kfree_skb_any(curr).
    But later, the segs is used by segs = segs->next and causes a uaf.
    
    As (next) = (curr)->next, my patch replaces seg->next to next.
    
    Fixes: 536577f36ff7a ("net: myri10ge: use skb_list_walk_safe helper for gso segments")
    Signed-off-by: Lv Yunlong <lyl2019@xxxxxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 1634ca6d4a8f..c84c8bf2bc20 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -2897,7 +2897,7 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
 			dev_kfree_skb_any(curr);
 			if (segs != NULL) {
 				curr = segs;
-				segs = segs->next;
+				segs = next;
 				curr->next = NULL;
 				dev_kfree_skb_any(segs);
 			}



[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