public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v3 4/7] net/sched: netem: restructure dequeue to avoid re-entrancy with child qdisc
Date: Mon, 6 Apr 2026 08:41:33 -0700	[thread overview]
Message-ID: <20260406084133.47bcfc8f@kernel.org> (raw)
In-Reply-To: <20260404094946.GU113102@horms.kernel.org>

On Sat, 4 Apr 2026 10:49:46 +0100 Simon Horman wrote:
> On Thu, Apr 02, 2026 at 01:19:32PM -0700, Stephen Hemminger wrote:
> > netem_dequeue() enqueues packets into its child qdisc while being
> > called from the parent's dequeue path. This causes two problems:
> > 
> > - HFSC tracks class active/inactive state on qlen transitions.
> >   A child enqueue during dequeue causes double-insertion into
> >   the eltree (CVE-2025-37890, CVE-2025-38001).
> > 
> > - Non-work-conserving children like TBF may refuse to dequeue
> >   packets just enqueued, causing netem to return NULL despite
> >   having backlog. Parents like DRR then incorrectly deactivate
> >   the class.
> > 
> > Split the dequeue into helpers:
> > 
> >   netem_pull_tfifo()    - remove head packet from tfifo
> >   netem_slot_account()  - update slot pacing counters
> >   netem_dequeue_child() - batch-transfer ready packets to the
> >                           child, then dequeue from the child
> >   netem_dequeue_direct()- dequeue from tfifo when no child
> > 
> > When a child qdisc is present, all time-ready packets are moved
> > into the child before calling its dequeue. This separates the
> > enqueue and dequeue phases so the parent sees consistent qlen
> > transitions.
> > 
> > Fixes: 50612537e9ab ("netem: fix classful handling")
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  net/sched/sch_netem.c | 201 +++++++++++++++++++++++++++---------------
> >  1 file changed, 128 insertions(+), 73 deletions(-)  
> 
> Hi Stephen,
> 
> As a fix this is a large and complex patch.
> Could it be split up somehow to aid review?

+1, FWIW it's perfectly fine to have refactoring patch in a net series
(without a Fixes tag) if it makes the fix a lot easier to review.

  reply	other threads:[~2026-04-06 15:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260402202037.176299-1-stephen@networkplumber.org>
2026-04-02 20:19 ` [PATCH net v3 1/7] net/sched: netem: fix probability gaps in 4-state loss model Stephen Hemminger
2026-04-04  9:50   ` Simon Horman
2026-04-02 20:19 ` [PATCH net v3 2/7] net/sched: netem: fix queue limit check to include reordered packets Stephen Hemminger
2026-04-04  9:50   ` Simon Horman
2026-04-02 20:19 ` [PATCH net v3 3/7] net/sched: netem: only reseed PRNG when seed is explicitly provided Stephen Hemminger
2026-04-04  9:50   ` Simon Horman
2026-04-02 20:19 ` [PATCH net v3 4/7] net/sched: netem: restructure dequeue to avoid re-entrancy with child qdisc Stephen Hemminger
2026-04-04  9:49   ` Simon Horman
2026-04-06 15:41     ` Jakub Kicinski [this message]
2026-04-06 17:12       ` Stephen Hemminger
2026-04-02 20:19 ` [PATCH net v3 5/7] net/sched: netem: null-terminate tfifo linear queue tail Stephen Hemminger
2026-04-04  9:50   ` Simon Horman
2026-04-02 20:19 ` [PATCH net v3 6/7] net/sched: netem: check for invalid slot range Stephen Hemminger
2026-04-04  9:51   ` Simon Horman
2026-04-02 20:19 ` [PATCH net v3 7/7] net/sched: netem: fix slot delay calculation overflow Stephen Hemminger
2026-04-04  9:51   ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260406084133.47bcfc8f@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox