lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM0EoMmtqe_09jpG8-HzTVKNs2gfi_qNNCDq4Y4CayRVuDF4Jg@mail.gmail.com>
Date: Fri, 28 Nov 2025 15:52:53 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Davide Caratti <dcaratti@...hat.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

Hi Davide,

On Fri, Nov 28, 2025 at 12:25 PM Davide Caratti <dcaratti@...hat.com> wrote:
>
> 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?

I may be misreading your thought process, seems you are thinking the
null ptr deref is in change()?
The null ptr deref (and the uaf if you add a delay) is in dequeue
(ets_qdisc_dequeue()) i.e not in change.
If that makes sense, what would be a more appropriate Fixes?

BTW, is that q->classes[i].qdisc = NULL even needed after this?
It was not clear whether it guards against something else that was not
obvious from inspection.

cheers,
jamal
> --
> davide
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ