[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSna9hYKaG7xvYSn@dcaratti.users.ipa.redhat.com>
Date: Fri, 28 Nov 2025 18:25:10 +0100
From: Davide Caratti <dcaratti@...hat.com>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com,
pabeni@...hat.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
netdev@...r.kernel.org, horms@...nel.org,
zdi-disclosures@...ndmicro.com, w@....eu, security@...nel.org,
tglx@...utronix.de, victor@...atatu.com
Subject: Re: [PATCH net] net/sched: ets: Always remove class from active list
before deleting in ets_qdisc_change
On Fri, Nov 28, 2025 at 10:19:19AM -0500, Jamal Hadi Salim wrote:
> zdi-disclosures@...ndmicro.com says:
>
> The vulnerability is a race condition between `ets_qdisc_dequeue` and
> `ets_qdisc_change`. It leads to UAF on `struct Qdisc` object.
> Attacker requires the capability to create new user and network namespace
> in order to trigger the bug.
> See my additional commentary at the end of the analysis.
hello, thanks for your patch!
[...]
>
> Fixes: de6d25924c2a ("net/sched: sch_ets: don't peek at classes beyond 'nbands'")
> Reported-by: zdi-disclosures@...ndmicro.com
> Tested-by: Victor Nogueira <victor@...atatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@...atatu.com>
> ---
> net/sched/sch_ets.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
> index 82635dd2cfa5..ae46643e596d 100644
> --- a/net/sched/sch_ets.c
> +++ b/net/sched/sch_ets.c
> @@ -652,7 +652,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
> sch_tree_lock(sch);
>
> for (i = nbands; i < oldbands; i++) {
> - if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
> + if (cl_is_active(&q->classes[i]))
> list_del_init(&q->classes[i].alist);
> qdisc_purge_queue(q->classes[i].qdisc);
> }
(nit)
the reported problem is NULL dereference of q->classes[i].qdisc, then
probably the 'Fixes' tag is an hash precedent to de6d25924c2a ("net/sched: sch_ets: don't
peek at classes beyond 'nbands'"). My understanding is: the test on 'q->classes[i].qdisc'
is no more NULL-safe after 103406b38c60 ("net/sched: Always pass notifications when
child class becomes empty"). So we might help our friends planning backports with something like:
Fixes: de6d25924c2a ("net/sched: sch_ets: don't peek at classes beyond 'nbands'")
Fixes: c062f2a0b04d ("net/sched: sch_ets: don't remove idle classes from the round-robin list")
WDYT?
--
davide
Powered by blists - more mailing lists