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: <20140908152206.GH6758@twins.programming.kicks-ass.net>
Date:	Mon, 8 Sep 2014 17:22:06 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Stephane Eranian <eranian@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read
 path

On Mon, Sep 08, 2014 at 04:31:07PM +0200, Jiri Olsa wrote:
> Revert PERF_EVENT_STATE_EXIT check on read syscall path.
> It breaks standard way to read counter, which is to open
> the counter, wait for the monitored process to die and
> read the counter.
> 
> Reported-by: Stephane Eranian <eranian@...gle.com>
> Acked-by: Stephane Eranian <eranian@...gle.com>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Stephane Eranian <eranian@...gle.com>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>

Thanks! 

> ---
>  kernel/events/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index d8cb4d21a346..6d1c9ce1643e 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -3600,8 +3600,7 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
>  	 * error state (i.e. because it was pinned but it couldn't be
>  	 * scheduled on to the CPU at some point).
>  	 */
> -	if ((event->state == PERF_EVENT_STATE_ERROR) ||
> -	    (event->state == PERF_EVENT_STATE_EXIT))
> +	if (event->state == PERF_EVENT_STATE_ERROR)
>  		return 0;
>  
>  	if (count < event->read_size)
> -- 
> 1.8.3.1
> 

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ