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  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]
Date:   Mon, 17 Feb 2020 18:33:40 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Tom Zanussi <zanussi@...nel.org>,
        artem.bityutskiy@...ux.intel.com, linux-kernel@...r.kernel.org,
        linux-rt-users@...r.kernel.org
Subject: Re: [PATCH] tracing: Skip software disabled event at
 __synth_event_trace_end()

On Wed, 12 Feb 2020 14:54:19 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:

> When the synthetic event is software disabled,
> __synth_event_trace_start() does not allocate an event buffer.
> In this case __synth_event_trace_end() also should not commit
> the buffer.
> 
> Check the trace_state->disabled at __synth_event_trace_end()
> and if it is disabled, skip it.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
>  kernel/trace/trace_events_hist.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index 483b3fd1094f..781e4b55e117 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1847,6 +1847,9 @@ __synth_event_trace_start(struct trace_event_file *file,
>  static inline void
>  __synth_event_trace_end(struct synth_event_trace_state *trace_state)
>  {
> +	if (trace_state->disabled)
> +		return;
> +

Aah, I assumed that trace_state should be initialized with 0, but
in really, it could be just allocated on the stack.
We has to set trace_state->disabled = false in __synth_event_trace_start().

Thank you,

>  	trace_event_buffer_commit(&trace_state->fbuffer);
>  
>  	ring_buffer_nest_end(trace_state->buffer);
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists