Skip to content

Commit e90c64f

Browse files
Lion Ackermannmdiewa
Lion Ackermann
authored andcommitted
net: sched: fix ordering of qlen adjustment
Changes to sch->q.qlen around qdisc_tree_reduce_backlog() need to happen _before_ a call to said function because otherwise it may fail to notify parent qdiscs when the child is about to become empty. Signed-off-by: Lion Ackermann <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 5eb7de8cd58e73851cd37ff8d0666517d9926948) CVE-2024-53164 Signed-off-by: Ian Whitfield <[email protected]> Acked-by: Magali Lemes <[email protected]> Acked-by: Benjamin M Romer <[email protected]> Signed-off-by: Manuel Diewald <[email protected]>
1 parent 189d069 commit e90c64f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/sched/sch_cake.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,6 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
15411541
b->backlogs[idx] -= len;
15421542
b->tin_backlog -= len;
15431543
sch->qstats.backlog -= len;
1544-
qdisc_tree_reduce_backlog(sch, 1, len);
15451544

15461545
flow->dropped++;
15471546
b->tin_dropped++;
@@ -1552,6 +1551,7 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
15521551

15531552
__qdisc_drop(skb, to_free);
15541553
sch->q.qlen--;
1554+
qdisc_tree_reduce_backlog(sch, 1, len);
15551555

15561556
cake_heapify(q, 0);
15571557

net/sched/sch_choke.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx,
124124
if (idx == q->tail)
125125
choke_zap_tail_holes(q);
126126

127+
--sch->q.qlen;
127128
qdisc_qstats_backlog_dec(sch, skb);
128129
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
129130
qdisc_drop(skb, sch, to_free);
130-
--sch->q.qlen;
131131
}
132132

133133
struct choke_skb_cb {

0 commit comments

Comments
 (0)