Skip to content

Commit 67a4c28

Browse files
congwangsfX-bot
authored andcommitted
net_sched: skbprio: Remove overly strict queue assertions
[ Upstream commit ce8fe975fd99b49c29c42e50f2441ba53112b2e8 ] 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: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=a3422a19b05ea96bee18 Fixes: aea5f65 ("net/sched: add skbprio scheduler") Cc: Nishanth Devarajan <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Paolo Abeni <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a76577a commit 67a4c28

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
@@ -121,8 +121,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
121121
/* Check to update highest and lowest priorities. */
122122
if (skb_queue_empty(lp_qdisc)) {
123123
if (q->lowest_prio == q->highest_prio) {
124-
/* The incoming packet is the only packet in queue. */
125-
BUG_ON(sch->q.qlen != 1);
126124
q->lowest_prio = prio;
127125
q->highest_prio = prio;
128126
} else {
@@ -154,7 +152,6 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)
154152
/* Update highest priority field. */
155153
if (skb_queue_empty(hpq)) {
156154
if (q->lowest_prio == q->highest_prio) {
157-
BUG_ON(sch->q.qlen);
158155
q->highest_prio = 0;
159156
q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1;
160157
} else {

0 commit comments

Comments
 (0)