net/sched: sch_dualpi2: Add missing skb check
Subsystems (3)
PATCH 1/1 net/sched: sch_dualpi2: Add missing skb check
A packed is dequeued using the function dequeue_packet() but there is no check to see if a packet is dequeued. The assignment is always considered as true resulting in null-ptr-deref
--- net/sched/sch_dualpi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_dualpi2.c +1 -1
@@ -588,7 +588,7 @@ static struct sk_buff *dualpi2_qdisc_dequeue(struct Qdisc *sch) now =ktime_get_ns (); -while ((skb =dequeue_packet (sch, q, &credit_change, now))) { +while ((skb =dequeue_packet (sch, q, &credit_change, now)) && skb) {if (!q->drop_early &&must_drop (sch, q, skb)) {drop_and_retry (q, skb, sch,QDISC_DROP_CONGESTED );continue ;
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerQuoted 8 lines · On Tue, 28 Apr 2026 20:27:30 +0530 Manas wrote:
A packed is dequeued using the function
dequeue_packet()but there is no check to see if a packet is dequeued. The assignment is always considered as true resulting in null-ptr-derefFixes 8f9516daedd6 ("sched: Add enqueue/dequeue of dualpi2 qdisc")Reported-by Manas <[email protected]>Reported-by Rakshit Awasthi <[email protected]>Signed-off-by Manas <[email protected]>
Sorry but the patch is nonsensical. Please don't waste our time.
Quoted 13 lines
net/sched/sch_dualpi2.c +1
-1@@ -588,7 +588,7 @@ static struct sk_buff *dualpi2_qdisc_dequeue(struct Qdisc *sch) now =ktime_get_ns (); -while ((skb =dequeue_packet (sch, q, &credit_change, now))) { +while ((skb =dequeue_packet (sch, q, &credit_change, now)) && skb) {if (!q->drop_early &&must_drop (sch, q, skb)) {drop_and_retry (q, skb, sch,QDISC_DROP_CONGESTED );continue ;
Signature · 1 line
pw-bot: cr
Jamal Hadi Salim
maintainerQuoted 6 lines · Jakub Kicinski
Quoted 4 lines · On Tue, 28 Apr 2026 20:27:30 +0530 Manas wrote:
A packed is dequeued using the function
dequeue_packet()but there is no check to see if a packet is dequeued. The assignment is always considered as true resulting in null-ptr-deref
Quoted 7 lines
Quoted 4 lines
Fixes 8f9516daedd6 ("sched: Add enqueue/dequeue of dualpi2 qdisc")Reported-by Manas <[email protected]>Reported-by Rakshit Awasthi <[email protected]>Signed-off-by Manas <[email protected]>Sorry but the patch is nonsensical. Please don't waste our time.
Fixed in: https://lore.kernel.org/netdev/[email protected]/T/#mfe773e91a05e103f47dfa71ea434210aebb74e17
As I have mentioned a few times, when you find issues, please either
a) describe how you found the issue (a reproducer helps) or b) provide tdc test case for extra bonus.
As you can see the issue has _nothing_ to do with dualpi2.
cheers,
jamal