FAILED: patch "[PATCH] net/sched: sch_taprio: Replace direct dequeue call with peek" failed to apply to 6.1-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x e056e1dfcddca877dd46d704e8ec9860cfc9ec44
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072145-tank-retrain-5dd2@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e056e1dfcddca877dd46d704e8ec9860cfc9ec44 Mon Sep 17 00:00:00 2001
From: Bryam Vargas <[email protected]>
Date: Thu, 25 Jun 2026 04:51:19 -0500
Subject: [PATCH] net/sched: sch_taprio: Replace direct dequeue call with peek
and qdisc_dequeue_peeked
When taprio's software path peeks a non-work-conserving child qdisc, the child stashes the peeked skb in its gso_skb; taprio_dequeue_from_txq() then takes the packet with a direct child ->dequeue() call, which ignores that stash, orphans the peeked skb and desyncs the child's qlen/backlog. With a qfq child this re-enters the child on an emptied list and dereferences NULL, panicking the kernel from softirq on ordinary egress.
Take the packet through qdisc_dequeue_peeked(), as sch_red and sch_sfb now do. The helper returns the child's stashed skb first and is a no-op when there is none, so a work-conserving child is unaffected and the gated path now consumes the skb whose length was charged to the budget.
net/sched/sch_taprio.c +1 -1
@@ -749,7 +749,7 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq,return NULL ; skip_peek_checks: - skb = child->ops->dequeue (child); + skb =qdisc_dequeue_peeked (child);if (unlikely (!skb))return NULL ;
Sasha Levin
maintainerPATCH 1/2 net/sched: taprio: avoid calling child->ops->dequeue(child) twice
From: Vladimir Oltean <[email protected]>
[ Upstream commit 4c22942734f0814d3c928c25a80f48df0a6ce45e ]
Simplify taprio_dequeue_from_txq() by noticing that we can goto one call earlier than the previous skb_found label. This is possible because we've unified the treatment of the child->ops->dequeue(child) return call, we always try other TXQs now, instead of abandoning the root dequeue completely if we failed in the peek() case.
Stable-dep-of: e056e1dfcddc ("net/sched: sch_taprio: Replace direct dequeue call with peek and qdisc_dequeue_peeked")
--- net/sched/sch_taprio.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
net/sched/sch_taprio.c +3 -7
@@ -567,12 +567,8 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq,if (unlikely (!child))return NULL ; -if (TXTIME_ASSIST_IS_ENABLED (q->flags)) { - skb = child->ops->dequeue (child); -if (!skb) -return NULL ; - goto skb_found; - } +if (TXTIME_ASSIST_IS_ENABLED (q->flags)) + goto skip_peek_checks; skb = child->ops->peek (child);if (!skb)
@@ -599,11 +595,11 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq, atomic_sub_return(len, &entry->budget) < 0)return NULL ; +skip_peek_checks: skb = child->ops->dequeue (child);if (unlikely (!skb))return NULL ; -skb_found:qdisc_bstats_update (sch, skb);qdisc_qstats_backlog_dec (sch, skb); sch->q.qlen--;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 net/sched: sch_taprio: Replace direct dequeue call with peek and qdisc_dequeue_peeked
From: Bryam Vargas <[email protected]>
[ Upstream commit e056e1dfcddca877dd46d704e8ec9860cfc9ec44 ]
When taprio's software path peeks a non-work-conserving child qdisc, the child stashes the peeked skb in its gso_skb; taprio_dequeue_from_txq() then takes the packet with a direct child ->dequeue() call, which ignores that stash, orphans the peeked skb and desyncs the child's qlen/backlog. With a qfq child this re-enters the child on an emptied list and dereferences NULL, panicking the kernel from softirq on ordinary egress.
Take the packet through qdisc_dequeue_peeked(), as sch_red and sch_sfb now do. The helper returns the child's stashed skb first and is a no-op when there is none, so a work-conserving child is unaffected and the gated path now consumes the skb whose length was charged to the budget.
--- net/sched/sch_taprio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_taprio.c +1 -1
@@ -596,7 +596,7 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq,return NULL ; skip_peek_checks: - skb = child->ops->dequeue (child); + skb =qdisc_dequeue_peeked (child);if (unlikely (!skb))return NULL ;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 net/sched: sch_taprio: Replace direct dequeue call with peek and qdisc_dequeue_peeked
In reply to [email protected]From: Bryam Vargas <[email protected]>
[ Upstream commit e056e1dfcddca877dd46d704e8ec9860cfc9ec44 ]
When taprio's software path peeks a non-work-conserving child qdisc, the child stashes the peeked skb in its gso_skb; taprio_dequeue_from_txq() then takes the packet with a direct child ->dequeue() call, which ignores that stash, orphans the peeked skb and desyncs the child's qlen/backlog. With a qfq child this re-enters the child on an emptied list and dereferences NULL, panicking the kernel from softirq on ordinary egress.
Take the packet through qdisc_dequeue_peeked(), as sch_red and sch_sfb now do. The helper returns the child's stashed skb first and is a no-op when there is none, so a work-conserving child is unaffected and the gated path now consumes the skb whose length was charged to the budget.
--- net/sched/sch_taprio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/sched/sch_taprio.c +2 -2
@@ -568,7 +568,7 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq,return NULL ;if (TXTIME_ASSIST_IS_ENABLED (q->flags)) { - skb = child->ops->dequeue (child); + skb =qdisc_dequeue_peeked (child);if (!skb)return NULL ; goto skb_found;
@@ -599,7 +599,7 @@ static struct sk_buff *taprio_dequeue_from_txq(struct Qdisc *sch, int txq, atomic_sub_return(len, &entry->budget) < 0)return NULL ; - skb = child->ops->dequeue (child); + skb =qdisc_dequeue_peeked (child);if (unlikely (!skb))return NULL ;
Signature · 1 line
2.53.0