Patch "sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb" has been added to the 4.19-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

    sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb

to the 4.19-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:
     sch_cake-return-__net_xmit_stolen-when-consuming-enq.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 539cead4f643a346aa5697a982e1f621d4b3302c
Author: Toke Høiland-Jørgensen <toke@xxxxxxx>
Date:   Wed Aug 31 11:21:03 2022 +0200

    sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb
    
    [ Upstream commit 90fabae8a2c225c4e4936723c38857887edde5cc ]
    
    When the GSO splitting feature of sch_cake is enabled, GSO superpackets
    will be broken up and the resulting segments enqueued in place of the
    original skb. In this case, CAKE calls consume_skb() on the original skb,
    but still returns NET_XMIT_SUCCESS. This can confuse parent qdiscs into
    assuming the original skb still exists, when it really has been freed. Fix
    this by adding the __NET_XMIT_STOLEN flag to the return value in this case.
    
    Fixes: 0c850344d388 ("sch_cake: Conditionally split GSO segments")
    Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxx>
    Reported-by: zdi-disclosures@xxxxxxxxxxxxxx # ZDI-CAN-18231
    Link: https://lore.kernel.org/r/20220831092103.442868-1-toke@xxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 18c207b85d513..c0a6947545280 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1666,6 +1666,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	}
 	idx--;
 	flow = &b->flows[idx];
+	ret = NET_XMIT_SUCCESS;
 
 	/* ensure shaper state isn't stale */
 	if (!b->tin_backlog) {
@@ -1726,6 +1727,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 
 		qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen);
 		consume_skb(skb);
+		ret |= __NET_XMIT_STOLEN;
 	} else {
 		/* not splitting */
 		cobalt_set_enqueue_time(skb, now);
@@ -1849,7 +1851,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 		}
 		b->drop_overlimit += dropped;
 	}
-	return NET_XMIT_SUCCESS;
+	return ret;
 }
 
 static struct sk_buff *cake_dequeue_one(struct Qdisc *sch)



[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