All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: <james.morse@arm.com>, <Dave.Martin@arm.com>,
	<babu.moger@amd.com>, <bp@alien8.de>, <tglx@linutronix.de>,
	<dave.hansen@linux.intel.com>, <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 v6 08/10] fs/resctrl: Prevent deadlock and use-after-free in info file handlers
Date: Tue, 7 Jul 2026 16:54:54 -0700	[thread overview]
Message-ID: <de91c9e5-4329-402c-8803-d875dc510f2f@intel.com> (raw)
In-Reply-To: <ak2M1RZ0EaMzPi7H@agluck-desk3>

Hi Tony,

On 7/7/26 4:33 PM, Luck, Tony wrote:
> On Mon, Jul 06, 2026 at 03:46:28PM -0700, Reinette Chatre wrote:
>> @@ -1020,9 +1030,15 @@ static int rdt_min_cbm_bits_show(struct kernfs_open_file *of,
>>  				 struct seq_file *seq, void *v)
>>  {
>>  	struct resctrl_schema *s = rdt_kn_parent_priv(of->kn);
>> -	struct rdt_resource *r = s->res;
>> +	struct rdt_resource *r;
>> +
> 
> Extra blank line added here.
>>  
>> +	if (!info_kn_lock(of->kn))
>> +		return -ENOENT;
>> +	r = s->res;
>>  	seq_printf(seq, "%u\n", r->cache.min_cbm_bits);
>> +	info_kn_unlock(of->kn);
>> +
>>  	return 0;
>>  }
>>  
> 
> ...
> 
>> @@ -1652,8 +1718,8 @@ static int mbm_config_show(struct seq_file *s, struct rdt_resource *r, u32 evtid
>>  	struct rdt_l3_mon_domain *dom;
>>  	bool sep = false;
>>  
>> -	cpus_read_lock();
>> -	mutex_lock(&rdtgroup_mutex);
>> +	lockdep_assert_cpus_held();
>> +	lockdep_assert_held(&rdtgroup_mutex);
>>  
>>  	list_for_each_entry_rcu(dom, &r->mon_domains, hdr.list, lockdep_is_cpus_held()) {
>>  		if (sep)
>> @@ -1670,8 +1736,6 @@ static int mbm_config_show(struct seq_file *s, struct rdt_resource *r, u32 evtid
>>  	}
>>  	seq_puts(s, "\n");
>>  
>> -	mutex_unlock(&rdtgroup_mutex);
>> -	cpus_read_unlock();
>>  
> 
> Extra blank line here after deleting those two lines.
> 
Thank you very much. I plan to send a new version of this series based on -rc3 next week unless
I learn about a better way to handle this before then.

Reinette


  reply	other threads:[~2026-07-07 23:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 22:46 [PATCH v6 00/10] x86,fs/resctrl: Fix long-standing issues Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 01/10] fs/resctrl: Free mon_data structures on rdt_get_tree() failure Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 02/10] fs/resctrl: Fix use-after-free during unmount Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 03/10] fs/resctrl: Fix double-add of pseudo-locked region's RMID to free list Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 04/10] x86,fs/resctrl: Document safe RCU list traversal Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 05/10] fs/resctrl: Move functions to avoid forward references in subsequent fixes Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 06/10] fs/resctrl: Fix deadlock on errors during mount Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 07/10] fs/resctrl: Prevent use-after-free in rdtgroup_kn_put() Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 08/10] fs/resctrl: Prevent deadlock and use-after-free in info file handlers Reinette Chatre
2026-07-07 23:33   ` Luck, Tony
2026-07-07 23:54     ` Reinette Chatre [this message]
2026-07-06 22:46 ` [PATCH v6 09/10] x86/resctrl: Ensure domain fully initialized before placed on RCU list Reinette Chatre
2026-07-06 22:46 ` [PATCH v6 10/10] fs/resctrl: Fix UAF from worker threads when domains are removed 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=de91c9e5-4329-402c-8803-d875dc510f2f@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.