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: <20250314125958.GC36322@noisy.programming.kicks-ass.net>
Date: Fri, 14 Mar 2025 13:59:58 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: kan.liang@...ux.intel.com
Cc: mingo@...hat.com, tglx@...utronix.de, bp@...en8.de, acme@...nel.org,
	namhyung@...nel.org, irogers@...gle.com,
	linux-kernel@...r.kernel.org, ak@...ux.intel.com,
	eranian@...gle.com
Subject: Re: [PATCH V9 3/7] perf: attach/detach PMU specific data

On Thu, Mar 13, 2025 at 05:02:38PM -0700, kan.liang@...ux.intel.com wrote:

> @@ -12551,6 +12813,14 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
>  	if (err)
>  		return ERR_PTR(err);
>  
> +	if (event->attach_state & PERF_ATTACH_TASK_DATA) {
> +		err = attach_perf_ctx_data(event);
> +		if (err) {
> +			security_perf_event_free(event);
> +			return ERR_PTR(err);
> +		}
> +	}
> +
>  	/* symmetric to unaccount_event() in _free_event() */
>  	account_event(event);
>  

This seems weird. We just pushed all the error handling into
__free_event(), and now you're adding one special case back.

Also, you've placed it after security_perf_event_alloc(), which I
_think_ wants to be last.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ