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: <d83bdff2-2665-4dcb-ab1d-c102bde7b46a@efficios.com>
Date: Wed, 28 Aug 2024 09:55:17 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
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 2024-07-02 02:02, Masami Hiramatsu (Google) wrote:
> 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));
> 

I'll do that for both the ftrace and the bpf patches and eliminate this
odd duplication. That's a good idea.

I'll add your Reviewed-by to all the "tracing/*" patches.

Thanks,

Mathieu

> But others looks good to me.
> 
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> 
> Thank you,
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ