Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net_sched: skbprio: Remove overly strict queue assertions

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: aea5f654e6b7 ("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>

authored by

Cong Wang and committed by
Jakub Kicinski
ce8fe975 078aabd5

-3
-3
net/sched/sch_skbprio.c
··· 123 123 /* Check to update highest and lowest priorities. */ 124 124 if (skb_queue_empty(lp_qdisc)) { 125 125 if (q->lowest_prio == q->highest_prio) { 126 - /* The incoming packet is the only packet in queue. */ 127 - BUG_ON(sch->q.qlen != 1); 128 126 q->lowest_prio = prio; 129 127 q->highest_prio = prio; 130 128 } else { ··· 154 156 /* Update highest priority field. */ 155 157 if (skb_queue_empty(hpq)) { 156 158 if (q->lowest_prio == q->highest_prio) { 157 - BUG_ON(sch->q.qlen); 158 159 q->highest_prio = 0; 159 160 q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1; 160 161 } else {