Netdev List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Gerrard Tai <gerrard.tai@starlabs.sg>,
	stable@vger.kernel.org
Subject: Re: [PATCH net] net_sched: sch_sfq: reject invalid perturb period
Date: Thu, 12 Jun 2025 13:11:07 -0700	[thread overview]
Message-ID: <aEs0W32lPsKZiZFp@pop-os.localdomain> (raw)
In-Reply-To: <20250611083501.1810459-1-edumazet@google.com>

On Wed, Jun 11, 2025 at 08:35:01AM +0000, Eric Dumazet wrote:
> Gerrard Tai reported that SFQ perturb_period has no range check yet,
> and this can be used to trigger a race condition fixed in a separate patch.
> 
> We want to make sure ctl->perturb_period * HZ will not overflow
> and is positive.
> 
> Tested:
> 
> tc qd add dev lo root sfq perturb -10   # negative value : error
> Error: sch_sfq: invalid perturb period.
> 
> tc qd add dev lo root sfq perturb 1000000000 # too big : error
> Error: sch_sfq: invalid perturb period.
> 
> tc qd add dev lo root sfq perturb 2000000 # acceptable value
> tc -s -d qd sh dev lo
> qdisc sfq 8005: root refcnt 2 limit 127p quantum 64Kb depth 127 flows 128 divisor 1024 perturb 2000000sec
>  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>  backlog 0b 0p requeues 0

Please kindly provide a selftest (as a separate patch) since it looks
fairly easy to reproduce. With AI copilot today, this becomes much
easier, so hopefully it won't bring you much burden. :)

Thanks.

      parent reply	other threads:[~2025-06-12 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11  8:35 [PATCH net] net_sched: sch_sfq: reject invalid perturb period Eric Dumazet
2025-06-12 15:10 ` patchwork-bot+netdevbpf
2025-06-12 20:11 ` Cong Wang [this message]

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=aEs0W32lPsKZiZFp@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gerrard.tai@starlabs.sg \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.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