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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGVEpHMkerjA2+0V@C02FL77VMD6R>
Date: Wed, 17 May 2023 14:18:28 -0700
From: Peilin Ye <yepeilin.cs@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Jamal Hadi Salim <jhs@...atatu.com>,
	Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
	Peilin Ye <peilin.ye@...edance.com>,
	Daniel Borkmann <daniel@...earbox.net>,
	John Fastabend <john.fastabend@...il.com>,
	Vlad Buslov <vladbu@...lanox.com>,
	Pedro Tammela <pctammela@...atatu.com>,
	Hillf Danton <hdanton@...a.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, Cong Wang <cong.wang@...edance.com>
Subject: Re: [PATCH net 6/6] net/sched: qdisc_destroy() old ingress and
 clsact Qdiscs before grafting

On Wed, May 17, 2023 at 11:48:25AM -0700, Jakub Kicinski wrote:
> >             } else {
> > -                   dev_queue = dev_ingress_queue(dev);
> > -                   old = dev_graft_qdisc(dev_queue, new);
> > +                   old = dev_graft_qdisc(dev_queue, NULL);
> > +
> > +                   /* {ingress,clsact}_destroy() "old" before grafting "new" to avoid
> > +                    * unprotected concurrent accesses to net_device::miniq_{in,e}gress
> > +                    * pointer(s) in mini_qdisc_pair_swap().
> > +                    */
> > +                   qdisc_notify(net, skb, n, classid, old, new, extack);
> > +                   qdisc_destroy(old);
> > +
> > +                   dev_graft_qdisc(dev_queue, new);
>
> BTW can't @old be NULL here?

ingress_queue->qdisc_sleeping is initialized to &noop_qdisc (placeholder)
in dev_ingress_queue_create(), and dev_graft_qdisc() also grafts
&noop_qdisc to represent "there's no Qdisc":

	/* ... and graft new one */
	if (qdisc == NULL)
		qdisc = &noop_qdisc;
	dev_queue->qdisc_sleeping = qdisc;

So @old can't be NULL here.

Thanks,
Peilin Ye


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ