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: <ZvcPpEJxeeDy_sGI@slm.duckdns.org>
Date: Fri, 27 Sep 2024 10:03:48 -1000
From: Tejun Heo <tj@...nel.org>
To: void@...ifault.com
Cc: kernel-team@...a.com, linux-kernel@...r.kernel.org, sched-ext@...a.com,
	aboorvad@...ux.ibm.com
Subject: Re: [PATCHSET sched_ext/for-6.12-fixes] sched_ext: Fix locking
 enable/disable path bugs includling locking order one

On Mon, Sep 23, 2024 at 08:59:27AM -1000, Tejun Heo wrote:
> Aboorva Devarajan reported an issue where sched_ext init code can
> occasionally deadlock when scheduler loading races CPU hotplug. The deadlock
> scenario is as follows:
> 
>        scx_ops_enable()                               hotplug
> 
>                                           percpu_down_write(&cpu_hotplug_lock)
>    percpu_down_write(&scx_fork_rwsem)
>    block on cpu_hotplug_lock
>                                           kthread_create() waits for kthreadd
> 					  kthreadd blocks on scx_fork_rwsem
> 
> Note that this doesn't trigger lockdep because the hotplug side dependency
> bounces through kthreadd.
> 
> This is primarily caused by SCX enable/disable paths grabbing big locks
> together. This patchset updates the enable/disable paths to decouple the
> locks. In the process, it also fixes several subtle bugs in the enable path.
> 
> This patchset contains the following patches:
> 
>  0001-sched_ext-Relocate-check_hotplug_seq-call-in-scx_ops.patch
>  0002-sched_ext-Remove-SCX_OPS_PREPPING.patch
>  0003-sched_ext-Initialize-in-bypass-mode.patch
>  0004-sched_ext-Fix-SCX_TASK_INIT-SCX_TASK_READY-transitio.patch
>  0005-sched_ext-Enable-scx_ops_init_task-separately.patch
>  0006-sched_ext-Add-scx_cgroup_enabled-to-gate-cgroup-oper.patch
>  0007-sched_ext-Decouple-locks-in-scx_ops_disable_workfn.patch
>  0008-sched_ext-Decouple-locks-in-scx_ops_enable.patch

Applied to sched_ext/for-6.12-fixes.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ