From: Paolo Abeni <pabeni@redhat.com>
To: Wei Tao <taowei@kylinos.cn>,
jhs@mojatatu.com, jiri@resnulli.us, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org
Cc: horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] net/sched: cls_flow: avoid integer overflow in perturb_period
Date: Thu, 12 Nov 2026 14:43:57 +0100 [thread overview]
Message-ID: <62abc297-daf8-415f-9450-202d226ebd9e@redhat.com> (raw)
In-Reply-To: <20261106063823.99731-1-taowei@kylinos.cn>
On 11/6/26 07:38, Wei Tao wrote:
> @@ -486,7 +487,13 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
> if (tb[TCA_FLOW_PERTURB]) {
> if (mode != FLOW_MODE_HASH)
> goto err2;
> - perturb_period = nla_get_u32(tb[TCA_FLOW_PERTURB]) * HZ;
> + val = nla_get_u32(tb[TCA_FLOW_PERTURB]);
> + if (val > INT_MAX / HZ) {
> + NL_SET_ERR_MSG_MOD(extack, "invalid perturb period");
> + err = -EINVAL;
> + goto err2;
Sashiko noted the added code could by simplified/substituted with
a NLA_POLICY_FULL_RANGE(NLA_U32, &range):
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106063823.99731-1-taowei@kylinos.cn
/P
prev parent reply other threads:[~2026-11-12 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 6:38 Wei Tao
2026-11-12 13:43 ` Paolo Abeni [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=62abc297-daf8-415f-9450-202d226ebd9e@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=taowei@kylinos.cn \
/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
all inboxes | Powered by JetHome®