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: <83fde43e-b74c-4686-8db1-9d28a60533ad@linaro.org>
Date: Thu, 6 Mar 2025 09:47:18 +0000
From: James Clark <james.clark@...aro.org>
To: Ian Rogers <irogers@...gle.com>, Peter Zijlstra <peterz@...radead.org>,
 Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>,
 Namhyung Kim <namhyung@...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] perf test: Fix leak in "Synthesize attr update" test



On 05/03/2025 7:19 pm, Ian Rogers wrote:
> The own_cpus map variable may be non-NULL and hold a reference, in
> particular on hybrid machines. Do a put before overwriting the
> variable to avoid a memory leak.
> 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>   tools/perf/tests/event_update.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
> index d6b4ce3ef4ee..9301fde11366 100644
> --- a/tools/perf/tests/event_update.c
> +++ b/tools/perf/tests/event_update.c
> @@ -109,6 +109,7 @@ static int test__event_update(struct test_suite *test __maybe_unused, int subtes
>   	TEST_ASSERT_VAL("failed to synthesize attr update name",
>   			!perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name));
>   
> +	perf_cpu_map__put(evsel->core.own_cpus);
>   	evsel->core.own_cpus = perf_cpu_map__new("1,2,3");
>   
>   	TEST_ASSERT_VAL("failed to synthesize attr update cpus",

Reviewed-by: James Clark <james.clark@...aro.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ