Skip to content

Commit 6341576

Browse files
Yunlongsdavem330
authored andcommitted
ethernet: myri10ge: Fix a use after free in myri10ge_sw_tso
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: 536577f ("net: myri10ge: use skb_list_walk_safe helper for gso segments") Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5954846 commit 6341576

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2897,7 +2897,7 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
28972897
dev_kfree_skb_any(curr);
28982898
if (segs != NULL) {
28992899
curr = segs;
2900-
segs = segs->next;
2900+
segs = next;
29012901
curr->next = NULL;
29022902
dev_kfree_skb_any(segs);
29032903
}

0 commit comments

Comments
 (0)