[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM0EoMn-YWEwAM0hys0v8_E4VLzasEu9JSdmjEda7f3tptCP-w@mail.gmail.com>
Date: Thu, 16 Jan 2025 08:34:00 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, jiri@...nulli.us, xiyou.wangcong@...il.com,
davem@...emloft.net, edumazet@...gle.com, security@...nel.org,
nnamrec@...il.com
Subject: Re: [PATCH net 1/1 v3] net: sched: Disallow replacing of child qdisc
from one parent to another
On Wed, Jan 15, 2025 at 8:33 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Wed, 15 Jan 2025 15:39:43 -0500 Jamal Hadi Salim wrote:
> > > diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> > > index 300430b8c4d2..fac9c946a4c7 100644
> > > --- a/net/sched/sch_api.c
> > > +++ b/net/sched/sch_api.c
> > > @@ -1664,6 +1664,10 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
> > > q = qdisc_lookup(dev, tcm->tcm_handle);
> > > if (!q)
> > > goto create_n_graft;
> > > + if (q->parent != tcm->tcm_parent) {
> > > + NL_SET_ERR_MSG(extack, "Cannot move an existing qdisc to a different parent");
> > > + return -EINVAL;
> > > + }
> >
> > Yes, this should work as well - doesnt have to save the leaf_q, so more optimal.
> > Please send the patch.
>
> I'm gonna keep your commit and just post a v4, hope that's okay.
Thanks!
cheers,
jamal
Powered by blists - more mailing lists