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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200619105827.c6042e60cdcd8609f5ec79e4@kernel.org>
Date:   Fri, 19 Jun 2020 10:58:27 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Sascha Ortmann <sascha.ortmann@...d.uni-hannover.de>
Cc:     linux-kernel@...cs.fau.de, linux-kernel@...r.kernel.org,
        linux-trace-devel@...r.kernel.org, maximilian.werner96@...il.com,
        mingo@...hat.com, rostedt@...dmis.org
Subject: Re: [PATCH v2] tracing/boottime: Fix kprobe multiple events

On Thu, 18 Jun 2020 18:33:01 +0200
Sascha Ortmann <sascha.ortmann@...d.uni-hannover.de> wrote:

> Fix boottime kprobe events to report and abort after each failure when
> adding probes.
> 
> As an example, when we try to set multiprobe kprobe events in
> bootconfig like this:
> 
> ftrace.event.kprobes.vfsevents {
>         probes = "vfs_read $arg1 $arg2,,
>                  !error! not reported;?", // leads to error
>                  "vfs_write $arg1 $arg2"
> }
> 
> This will not work as expected. After 
> commit da0f1f4167e3af69e ("tracing/boottime: Fix kprobe event API usage"), 
> the function trace_boot_add_kprobe_event will not produce any error 
> message when adding a probe fails at kprobe_event_gen_cmd_start. 
> Furthermore, we continue to add probes when kprobe_event_gen_cmd_end fails
> (and kprobe_event_gen_cmd_start did not fail). In this case the function 
> even returns successfully when the last call to kprobe_event_gen_cmd_end
> is successful.
> 
> The behaviour of reporting and aborting after failures is not
> consistent.
> 
> The function trace_boot_add_kprobe_event now reports each failure and
> stops adding probes immediately.

Thanks for updating. This looks good to me. 

Acked-by: Masami Hiramatsu <mhiramat@...nel.org>

and 

Fixes: da0f1f4167e3 ("tracing/boottime: Fix kprobe event API usage")

Thank you!

> 
> Cc: linux-kernel@...cs.fau.de
> Co-developed-by: Maximilian Werner <maximilian.werner96@...il.com>
> Signed-off-by: Maximilian Werner <maximilian.werner96@...il.com>
> Signed-off-by: Sascha Ortmann <sascha.ortmann@...d.uni-hannover.de>
> ---
>  kernel/trace/trace_boot.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
> index 9de29bb45a27..be893eb22071 100644
> --- a/kernel/trace/trace_boot.c
> +++ b/kernel/trace/trace_boot.c
> @@ -101,12 +101,16 @@ trace_boot_add_kprobe_event(struct xbc_node *node, const char *event)
>  		kprobe_event_cmd_init(&cmd, buf, MAX_BUF_LEN);
>  
>  		ret = kprobe_event_gen_cmd_start(&cmd, event, val);
> -		if (ret)
> +		if (ret) {
> +			pr_err("Failed to generate probe: %s\n", buf);
>  			break;
> +		}
>  
>  		ret = kprobe_event_gen_cmd_end(&cmd);
> -		if (ret)
> +		if (ret) {
>  			pr_err("Failed to add probe: %s\n", buf);
> +			break;
> +		}
>  	}
>  
>  	return ret;
> -- 
> 2.17.1
> 


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ