Skip to content

Commit 2f35b76

Browse files
congwanggregkh
authored andcommitted
net_sched: skbprio: Remove overly strict queue assertions
[ Upstream commit ce8fe97 ] In the current implementation, skbprio enqueue/dequeue contains an assertion that fails under certain conditions when SKBPRIO is used as a child qdisc under TBF with specific parameters. The failure occurs because TBF sometimes peeks at packets in the child qdisc without actually dequeuing them when tokens are unavailable. This peek operation creates a discrepancy between the parent and child qdisc queue length counters. When TBF later receives a high-priority packet, SKBPRIO's queue length may show a different value than what's reflected in its internal priority queue tracking, triggering the assertion. The fix removes this overly strict assertions in SKBPRIO, they are not necessary at all. Reported-by: syzbot+a3422a19b05ea96bee18@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=a3422a19b05ea96bee18 Fixes: aea5f65 ("net/sched: add skbprio scheduler") Cc: Nishanth Devarajan <ndev2021@gmail.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Link: https://patch.msgid.link/20250329222536.696204-2-xiyou.wangcong@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3ba9cf6 commit 2f35b76

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

net/sched/sch_skbprio.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
123123
/* Check to update highest and lowest priorities. */
124124
if (skb_queue_empty(lp_qdisc)) {
125125
if (q->lowest_prio == q->highest_prio) {
126-
/* The incoming packet is the only packet in queue. */
127-
BUG_ON(sch->q.qlen != 1);
128126
q->lowest_prio = prio;
129127
q->highest_prio = prio;
130128
} else {
@@ -156,7 +154,6 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)
156154
/* Update highest priority field. */
157155
if (skb_queue_empty(hpq)) {
158156
if (q->lowest_prio == q->highest_prio) {
159-
BUG_ON(sch->q.qlen);
160157
q->highest_prio = 0;
161158
q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1;
162159
} else {

0 commit comments

Comments
 (0)