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: <20240702090202.bc000b44890fe16d9b757b40@kernel.org>
Date: Tue, 2 Jul 2024 09:02:02 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
 Peter Zijlstra <peterz@...radead.org>, Alexei Starovoitov <ast@...nel.org>,
 Yonghong Song <yhs@...com>, "Paul E . McKenney" <paulmck@...nel.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@...hat.com>,
 Namhyung Kim <namhyung@...nel.org>, bpf@...r.kernel.org, Joel Fernandes
 <joel@...lfernandes.org>, Michael Jeanson <mjeanson@...icios.com>
Subject: Re: [PATCH v5 6/8] tracing/bpf-trace: Add support for faultable
 tracepoints

On Wed, 26 Jun 2024 14:59:39 -0400
Mathieu Desnoyers <mathieu.desnoyers@...icios.com> wrote:

> @@ -2443,9 +2443,15 @@ static int __bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *
>  	if (prog->aux->max_tp_access > btp->writable_size)
>  		return -EINVAL;
>  
> -	return tracepoint_probe_register_prio_flags(tp, (void *)btp->bpf_func,
> -						    prog, TRACEPOINT_DEFAULT_PRIO,
> -						    TRACEPOINT_MAY_EXIST);
> +	if (tp->flags & TRACEPOINT_MAY_FAULT) {
> +		return tracepoint_probe_register_prio_flags(tp, (void *)btp->bpf_func,
> +							    prog, TRACEPOINT_DEFAULT_PRIO,
> +							    TRACEPOINT_MAY_EXIST | TRACEPOINT_MAY_FAULT);
> +	} else {
> +		return tracepoint_probe_register_prio_flags(tp, (void *)btp->bpf_func,
> +							    prog, TRACEPOINT_DEFAULT_PRIO,
> +							    TRACEPOINT_MAY_EXIST);
> +	}

nit: you can also just pass the flag directly,

		return tracepoint_probe_register_prio_flags(tp, (void *)btp->bpf_func,
							    prog, TRACEPOINT_DEFAULT_PRIO,
							    TRACEPOINT_MAY_EXIST | (tp->flags & TRACEPOINT_MAY_FAULT));

But others looks good to me.

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>

Thank you,

-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ