Patch "netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()" has been added to the 6.12-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

    netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()

to the 6.12-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:
     netem-update-sch-q.qlen-before-qdisc_tree_reduce_bac.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 944010266fa6b448259f14df40c7314cd75653a8
Author: Cong Wang <cong.wang@xxxxxxxxxxxxx>
Date:   Mon Feb 3 16:58:40 2025 -0800

    netem: Update sch->q.qlen before qdisc_tree_reduce_backlog()
    
    [ Upstream commit 638ba5089324796c2ee49af10427459c2de35f71 ]
    
    qdisc_tree_reduce_backlog() notifies parent qdisc only if child
    qdisc becomes empty, therefore we need to reduce the backlog of the
    child qdisc before calling it. Otherwise it would miss the opportunity
    to call cops->qlen_notify(), in the case of DRR, it resulted in UAF
    since DRR uses ->qlen_notify() to maintain its active list.
    
    Fixes: f8d4bc455047 ("net/sched: netem: account for backlog updates from child qdisc")
    Cc: Martin Ottens <martin.ottens@xxxxxx>
    Reported-by: Mingi Cho <mincho@xxxxxxxxx>
    Signed-off-by: Cong Wang <cong.wang@xxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20250204005841.223511-4-xiyou.wangcong@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 3b519adc01259..68a08f6d1fbce 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -748,9 +748,9 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 				if (err != NET_XMIT_SUCCESS) {
 					if (net_xmit_drop_count(err))
 						qdisc_qstats_drop(sch);
-					qdisc_tree_reduce_backlog(sch, 1, pkt_len);
 					sch->qstats.backlog -= pkt_len;
 					sch->q.qlen--;
+					qdisc_tree_reduce_backlog(sch, 1, pkt_len);
 				}
 				goto tfifo_dequeue;
 			}




[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