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: <ZqFOE9PkW39h2mHs@x1>
Date: Wed, 24 Jul 2024 15:55:15 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Ian Rogers <irogers@...gle.com>, Kan Liang <kan.liang@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	linux-perf-users@...r.kernel.org, KP Singh <kpsingh@...nel.org>,
	Song Liu <song@...nel.org>, bpf@...r.kernel.org,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v3 1/8] perf bpf-filter: Make filters map a single entry
 hashmap

On Wed, Jul 03, 2024 at 03:30:28PM -0700, Namhyung Kim wrote:
> And the value is now an array.  This is to support multiple filter
> entries in the map later.
 
> No functional changes intended.

> +++ b/tools/perf/util/bpf-filter.c
> @@ -93,71 +93,102 @@ static int check_sample_flags(struct evsel *evsel, struct perf_bpf_filter_expr *
>  
>  int perf_bpf_filter__prepare(struct evsel *evsel)
>  {
> -	int i, x, y, fd;
> +	int i, x, y, fd, ret;
>  	struct sample_filter_bpf *skel;
>  	struct bpf_program *prog;
>  	struct bpf_link *link;
>  	struct perf_bpf_filter_expr *expr;
> +	struct perf_bpf_filter_entry *entry;
> +
> +	entry = calloc(MAX_FILTERS, sizeof(*entry));
> +	if (entry == NULL)
> +		return -1;

I'm changing this to -ENOMEM since you use errno values in the other
failure cases, ok?

This:

diff --git a/tools/perf/util/bpf-filter.c b/tools/perf/util/bpf-filter.c
index 2510832d83f95e03..e98bacf41a248ced 100644
--- a/tools/perf/util/bpf-filter.c
+++ b/tools/perf/util/bpf-filter.c
@@ -102,7 +102,7 @@ int perf_bpf_filter__prepare(struct evsel *evsel)
 
 	entry = calloc(MAX_FILTERS, sizeof(*entry));
 	if (entry == NULL)
-		return -1;
+		return -ENOMEM;
 
 	skel = sample_filter_bpf__open_and_load();
 	if (!skel) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ