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: <aAqJLMbmNpnisNcN@slm.duckdns.org>
Date: Thu, 24 Apr 2025 08:55:40 -1000
From: Tejun Heo <tj@...nel.org>
To: Chengming Zhou <chengming.zhou@...ux.dev>
Cc: David Vernet <void@...ifault.com>, Andrea Righi <arighi@...dia.com>,
	Changwoo Min <changwoo@...lia.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/12] sched_ext: Avoid NULL scx_root deref through
 SCX_HAS_OP()

Hello,

On Thu, Apr 24, 2025 at 03:23:40PM +0800, Chengming Zhou wrote:
> > +	/*
> > +	 * scx_root updates are protected by cpus_read_lock() and will stay
> > +	 * stable here. Note that we can't depend on scx_enabled() test as the
> > +	 * hotplug ops need to be enabled before __scx_enabled is set.
> > +	 */
> > +	if (!scx_root)
> > +		return;
> > +
> >   	if (scx_enabled())
> >   		scx_idle_update_selcpu_topology(&scx_root->ops);
> 
> Just be curious, does the comments added above mean we shouldn't
> check scx_enabled() here anymore?

There are two things happening in the function - calling the idle topology
update function and calling ops.cpu_on/offline(). The former needs both
scx_root and scx_enabled(). The latter only scx_root, so we still need the
additional scx_enabled() check for the former.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ