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: <20170802073518.GC13890@krava>
Date:   Wed, 2 Aug 2017 09:35:18 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH v1 02/15] perf, tools: Tighten detection of BPF events

On Mon, Jul 24, 2017 at 04:40:02PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
> 
> perf stat -e cpu/uops_executed.core,cmask=1/
> 
> would be detected as a BPF source event because the .c matches the .c
> source BPF pattern.
> 
> Add lookahead to the BPF patterns and reject them if they are followed
> by more letters.
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>

I don't have the llvm/bpf toolchain, so can't test that side,
but Arnaldo will run it for sure ;-) anyway looks ok to me:

Acked-by: Jiri Olsa <jolsa@...nel.org>

thanks,
jirka

> ---
>  tools/perf/util/parse-events.l | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
> index 660fca05bc93..7fa3f2e851b0 100644
> --- a/tools/perf/util/parse-events.l
> +++ b/tools/perf/util/parse-events.l
> @@ -182,9 +182,13 @@ modifier_bp	[rwx]{1,3}
>  			REWIND(0);
>  		}
>  
> +({bpf_object}|{bpf_source})/[^a-z] {
> +			BEGIN(INITIAL);
> +			REWIND(1);
> +			return PE_EVENT_NAME;
> +		}
> +
>  {event_pmu}	|
> -{bpf_object}	|
> -{bpf_source}	|
>  {event}		{
>  			BEGIN(INITIAL);
>  			REWIND(1);
> @@ -307,8 +311,8 @@ r{num_raw_hex}		{ return raw(yyscanner); }
>  {num_hex}		{ return value(yyscanner, 16); }
>  
>  {modifier_event}	{ return str(yyscanner, PE_MODIFIER_EVENT); }
> -{bpf_object}		{ return str(yyscanner, PE_BPF_OBJECT); }
> -{bpf_source}		{ return str(yyscanner, PE_BPF_SOURCE); }
> +{bpf_object}/[^a-z]	{ return str(yyscanner, PE_BPF_OBJECT); }
> +{bpf_source}/[^a-z]	{ return str(yyscanner, PE_BPF_SOURCE); }
>  {name}			{ return pmu_str_check(yyscanner); }
>  "/"			{ BEGIN(config); return '/'; }
>  -			{ return '-'; }
> -- 
> 2.9.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ