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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160321150905.GD11676@codeblueprint.co.uk>
Date:	Mon, 21 Mar 2016 15:09:05 +0000
From:	Matt Fleming <matt@...eblueprint.co.uk>
To:	vikas.shivappa@...ux.intel.com, dsahern@...il.com,
	namhyung@...nel.org, mingo@...nel.org, peterz@...radead.org,
	brgerst@...il.com, bp@...en8.de, dvlasenk@...hat.com,
	vincent.weaver@...ne.edu, torvalds@...ux-foundation.org,
	eranian@...gle.com, tony.luck@...el.com, tglx@...utronix.de,
	alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
	luto@...capital.net, hpa@...or.com, jolsa@...hat.com,
	acme@...hat.com
Cc:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/urgent] perf/x86/mbm: Implement RMID recycling

On Mon, 21 Mar, at 02:53:04AM, tip-bot for Vikas Shivappa wrote:
> @@ -489,6 +496,22 @@ static u32 intel_cqm_xchg_rmid(struct perf_event *group, u32 rmid)
>  
>  	raw_spin_unlock_irq(&cache_lock);
>  
> +	/*
> +	 * If the allocation is for mbm, init the mbm stats.
> +	 * Need to check if each event in the group is mbm event
> +	 * because there could be multiple type of events in the same group.
> +	 */
> +	if (__rmid_valid(rmid)) {
> +		event = group;
> +		if (is_mbm_event(event->attr.config))
> +			init_mbm_sample(rmid, event->attr.config);
> +
> +		list_for_each_entry(event, head, hw.cqm_group_entry) {
> +			if (is_mbm_event(event->attr.config))
> +				init_mbm_sample(rmid, event->attr.config);
> +		}
> +	}
> +
>  	return old_rmid;
>  }
>  

You're calling init_mbm_sample() without holding cache_lock. Won't
this potentially trash the existing value in MSR_IA32_QM_EVTSEL, if
say, we're reading the counter at the same time as the recycling
worker is running?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ