From: Tejun Heo <tj@kernel.org>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Jing-Ting Wu <jing-ting.wu@mediatek.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Zefan Li <lizefan.x@bytedance.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Shakeel Butt <shakeelb@google.com>,
wsd_upstream@mediatek.com, lixiong.liu@mediatek.com,
wenju.xu@mediatek.com, jonathan.jmchen@mediatek.com
Subject: Re: [Bug] race condition at rebind_subsystems()
Date: Fri, 15 Jul 2022 06:47:59 -1000 [thread overview]
Message-ID: <YtGaP+e35DZYSQf0@slm.duckdns.org> (raw)
In-Reply-To: <20220715115938.GA8646@blackbody.suse.cz>
(resending, I messed up the message header, sorry)
Hello,
On Fri, Jul 15, 2022 at 01:59:38PM +0200, Michal Koutný wrote:
> The css->rstat_css_node should not be modified if there are possible RCU
> readers elsewhere.
> One way to fix this would be to insert synchronize_rcu() after
> list_del_rcu() and before list_add_rcu().
> (A further alternative (I've heard about) would be to utilize 'nulls'
> RCU lists [1] to make the move between lists detectable.)
>
> But as I'm looking at it from distance, it may be simpler and sufficient
> to just take cgroup_rstat_lock around the list migration (the nesting
> under cgroup_mutex that's held with rebind_subsystems() is fine).
synchronize_rcu() prolly is the better fit here given how that list_node's
usage, but yeah, great find.
Thanks.
--
tejun
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-07-15 16:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 10:52 [Bug] race condition at rebind_subsystems() Jing-Ting Wu
2022-07-15 11:59 ` Michal Koutný
2022-07-15 16:47 ` Tejun Heo [this message]
2022-07-18 7:44 ` Jing-Ting Wu
2022-07-19 13:35 ` Michal Koutný
2022-07-21 6:46 ` Jing-Ting Wu
2022-08-07 6:58 ` Jing-Ting Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YtGaP+e35DZYSQf0@slm.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jing-ting.wu@mediatek.com \
--cc=jonathan.jmchen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lixiong.liu@mediatek.com \
--cc=lizefan.x@bytedance.com \
--cc=matthias.bgg@gmail.com \
--cc=mkoutny@suse.com \
--cc=shakeelb@google.com \
--cc=wenju.xu@mediatek.com \
--cc=wsd_upstream@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).