[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZoWfnS6NvEoNckGO@slm.duckdns.org>
Date: Wed, 3 Jul 2024 08:59:41 -1000
From: Tejun Heo <tj@...nel.org>
To: Waiman Long <longman@...hat.com>
Cc: Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cgroup: Protect css->cgroup write under css_set_lock
On Wed, Jul 03, 2024 at 02:52:29PM -0400, Waiman Long wrote:
> The writing of css->cgroup associated with the cgroup root in
> rebind_subsystems() is currently protected only by cgroup_mutex.
> However, the reading of css->cgroup in both proc_cpuset_show() and
> proc_cgroup_show() is protected just by css_set_lock. That makes the
> readers susceptible to racing problems like data tearing or caching.
> It is also a problem that can be reported by KCSAN.
>
> This can be fixed by using READ_ONCE() and WRITE_ONCE() to access
> css->cgroup. Alternatively, the writing of css->cgroup can be moved
> under css_set_lock as well which is done by this patch.
>
> Signed-off-by: Waiman Long <longman@...hat.com>
Applied to cgroup/for-6.10-fixes.
Thanks.
--
tejun
Powered by blists - more mailing lists