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] [day] [month] [year] [list]
Message-ID: <ZvsSKpa0UhcVKBma@google.com>
Date: Mon, 30 Sep 2024 14:03:38 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Kan Liang <kan.liang@...ux.intel.com>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/4] perf stat: Fix affinity memory leaks on error path

On Tue, Sep 24, 2024 at 01:29:13PM -0700, Ian Rogers wrote:
> Missed cleanup when an error occurs.

I think there's one more place for this - after bpf_counter__load()
failed.  You may add a new label to handle it together in the error
path.

Also it doesn't apply to the latest tree, please rebase!

Thanks,
Namhyung

> 
> Fixes: 49de179577e7 ("perf stat: No need to setup affinities when starting a workload")
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/builtin-stat.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index 689a3d43c258..cc55df3ccb18 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -767,6 +767,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
>  
>  			switch (stat_handle_error(counter)) {
>  			case COUNTER_FATAL:
> +				affinity__cleanup(affinity);
>  				return -1;
>  			case COUNTER_RETRY:
>  				goto try_again;
> @@ -808,6 +809,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
>  
>  				switch (stat_handle_error(counter)) {
>  				case COUNTER_FATAL:
> +					affinity__cleanup(affinity);
>  					return -1;
>  				case COUNTER_RETRY:
>  					goto try_again_reset;
> -- 
> 2.46.0.792.g87dc391469-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ