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  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]
Date:   Mon, 11 Nov 2019 11:13:01 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Andi Kleen <ak@...ux.intel.com>, linux-kernel@...r.kernel.org,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH] perf tools: address 2 parse event memory leaks

Em Fri, Nov 08, 2019 at 11:58:40PM -0800, Ian Rogers escreveu:
> Using return rather than YYABORT means that the stack isn't cleared up
> following a failure. The change to YYABORT means the return value is 1
> rather than -1, but the callers just check for a result of 0 (success).
> Add missing free of a list when an error occurs in event_pmu.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/util/parse-events.y | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> index 4cac830015be..e2eea4e601b4 100644
> --- a/tools/perf/util/parse-events.y
> +++ b/tools/perf/util/parse-events.y
> @@ -284,6 +284,7 @@ PE_NAME opt_pmu_config
>  	do {						\
>  		parse_events_terms__delete($2);		\
>  		parse_events_terms__delete(orig_terms);	\
> +		free(list);				\
>  		free($1);				\
>  		free(pattern);				\
>  		YYABORT;				\
> @@ -550,7 +551,7 @@ tracepoint_name opt_event_config
>  	free($1.event);
>  	if (err) {
>  		free(list);
> -		return -1;
> +		YYABORT;
>  	}
>  	$$ = list;
>  }
> -- 
> 2.24.0.432.g9d3f5f5b63-goog

-- 

- Arnaldo

Powered by blists - more mailing lists