From: Reinette Chatre <reinette.chatre@intel.com>
To: <tony.luck@intel.com>, <james.morse@arm.com>,
<Dave.Martin@arm.com>, <babu.moger@amd.com>, <bp@alien8.de>,
<tglx@linutronix.de>, <dave.hansen@linux.intel.com>
Cc: <x86@kernel.org>, <hpa@zytor.com>, <ben.horgan@arm.com>,
<fustini@kernel.org>, <fenghuay@nvidia.com>,
<peternewman@google.com>, <yu.c.chen@intel.com>,
<linux-kernel@vger.kernel.org>, <patches@lists.linux.dev>
Subject: Re: [PATCH v4 01/10] x86,fs/resctrl: Document safe RCU list traversal
Date: Thu, 4 Jun 2026 08:30:51 -0700 [thread overview]
Message-ID: <f942bae3-4909-434a-88e2-57b77c3ce6da@intel.com> (raw)
In-Reply-To: <776eb116e624f312239fa71cb20d9005e0f709fb.1780456704.git.reinette.chatre@intel.com>
On 6/2/26 8:27 PM, Reinette Chatre wrote:
> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> index b20e705606b8..e74f1ed54b86 100644
> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> @@ -53,7 +53,7 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
> /* Walking r->domains, ensure it can't race with cpuhp */
> lockdep_assert_cpus_held();
>
> - list_for_each_entry(d, &r->ctrl_domains, hdr.list) {
> + list_for_each_entry_rcu(d, &r->ctrl_domains, hdr.list, lockdep_is_cpus_held()) {
> hw_dom = resctrl_to_arch_ctrl_dom(d);
> msr_param.res = NULL;
> for (t = 0; t < CDP_NUM_TYPES; t++) {
Sashiko [1] pointed out that no stub exists for lockdep_is_cpus_held() when CONFIG_HOTPLUG_CPU
is disabled.
Before this series lockdep_is_cpus_held() only has one caller and it protects the call with an
IS_ENABLED(CONFIG_HOTPLUG_CPU) check. This caught me as I am more familiar with the style of
lockdep_is_held(). I find it safer to not need to prefix all lockdep_is_cpus_held() calls with
an IS_ENABLED(CONFIG_HOTPLUG_CPU) check so I submitted an independent change to CPU hotplug
to add the stubs [2]. Thanks to Thomas this was just merged to smp/core branch of tip.
In the mean time, I believe it to be unlikely that anybody would disable CONFIG_SMP when using
resctrl and CONFIG_HOTPLUG_CPU cannot be disabled by user and depends on CONFIG_SMP per:
arch/x86/Kconfig:
config HOTPLUG_CPU
def_bool y
depends on SMP
Reinette
[1] https://sashiko.dev/#/patchset/cover.1780456704.git.reinette.chatre%40intel.com?part=1
[2] https://lore.kernel.org/lkml/cover.1780543665.git.reinette.chatre@intel.com/
next prev parent reply other threads:[~2026-06-04 15:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 3:27 [PATCH v4 00/10] x86,fs/resctrl: Fix long-standing issues Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 01/10] x86,fs/resctrl: Document safe RCU list traversal Reinette Chatre
2026-06-04 15:30 ` Reinette Chatre [this message]
2026-06-03 3:27 ` [PATCH v4 02/10] fs/resctrl: Move functions to avoid forward references in subsequent fixes Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 03/10] fs/resctrl: Free mon_data structures on rdt_get_tree() failure Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 04/10] fs/resctrl: Fix use-after-free during unmount Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 05/10] fs/resctrl: Fix deadlock on errors during mount Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 06/10] fs/resctrl: Prevent use-after-free in rdtgroup_kn_put() Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 07/10] fs/resctrl: Fix double-add of pseudo-locked region's RMID to free list Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 08/10] fs/resctrl: Prevent deadlock and use-after-free in info file handlers Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 09/10] x86/resctrl: Ensure domain fully initialized before placed on RCU list Reinette Chatre
2026-06-03 3:27 ` [PATCH v4 10/10] fs/resctrl: Fix UAF from worker threads when domains are removed Reinette Chatre
2026-06-04 15:31 ` Reinette Chatre
2026-06-04 15:28 ` [PATCH v4 00/10] x86,fs/resctrl: Fix long-standing issues Reinette Chatre
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=f942bae3-4909-434a-88e2-57b77c3ce6da@intel.com \
--to=reinette.chatre@intel.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghuay@nvidia.com \
--cc=fustini@kernel.org \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=peternewman@google.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.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
all inboxes | Powered by JetHome®