[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44cd376a-8fee-4d82-a465-a0e80e67135c@redhat.com>
Date: Thu, 15 May 2025 10:51:20 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: chia-yu.chang@...ia-bell-labs.com, horms@...nel.org,
donald.hunter@...il.com, xandfury@...il.com, netdev@...r.kernel.org,
dave.taht@...il.com, jhs@...atatu.com, kuba@...nel.org,
stephen@...workplumber.org, xiyou.wangcong@...il.com, jiri@...nulli.us,
davem@...emloft.net, edumazet@...gle.com, andrew+netdev@...n.ch,
ast@...erby.net, liuhangbin@...il.com, shuah@...nel.org,
linux-kselftest@...r.kernel.org, ij@...nel.org, ncardwell@...gle.com,
koen.de_schepper@...ia-bell-labs.com, g.white@...lelabs.com,
ingemar.s.johansson@...csson.com, mirja.kuehlewind@...csson.com,
cheshire@...le.com, rs.ietf@....at, Jason_Livingood@...cast.com,
vidhi_goel@...le.com
Subject: Re: [PATCH v15 net-next 1/5] sched: Struct definition and parsing of
dualpi2 qdisc
On 5/9/25 11:47 PM, chia-yu.chang@...ia-bell-labs.com wrote:
> +struct dualpi2_sched_data {
> + struct Qdisc *l_queue; /* The L4S Low latency queue (L-queue) */
> + struct Qdisc *sch; /* The Classic queue (C-queue) */
> +
> + /* Registered tc filters */
> + struct tcf_proto __rcu *tcf_filters;
> + struct tcf_block *tcf_block;
> +
> + /* PI2 parameters */
> + u64 pi2_target; /* Target delay in nanoseconds */
> + u32 pi2_tupdate; /* Timer frequency in nanoseconds */
AFAICS this can be written from user-space, without any upper bound,
causing an integer overflow after converting the frequency from seconds
to nsec.
> +static enum hrtimer_restart dualpi2_timer(struct hrtimer *timer)
> +{
> + struct dualpi2_sched_data *q = from_timer(q, timer, pi2_timer);
> +
> + WRITE_ONCE(q->pi2_prob, calculate_probability(q->sch));
This runs without acquiring the qdisc_lock(). The state accessed by
calculate_probability() could be inconsistent. You likely need to
acquire the qdisc_lock here.
/P
Powered by blists - more mailing lists