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: <20210611105011.092650f2b921ce36325eff79@kernel.org>
Date:   Fri, 11 Jun 2021 10:50:11 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
        <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
Subject: Re: [PATCH] kprobes: Print an error if probe is rejected

On Thu, 10 Jun 2021 13:33:46 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

> On Thu, 10 Jun 2021 19:16:43 +0900
> Masami Hiramatsu <mhiramat@...nel.org> wrote:
> 
> > Hmm, Nack for this way, but I understand that is a problem.
> > If you got the error in perf probe, which uses ftrace dynamic-event interface.
> > In that case, the errors should not be output in the dmesg, but are reported
> > via error_log in tracefs.
> > And kprobes itself should return different error code to the caller, instead
> > of printing error in dmesg. See below.
> 
> We should update perf to use libtracefs that also has an interface to
> read the error_log file.

Hmm, it seems that libtracefs has no parser for the error_log file.

What we need is to parse error_log and find appropriate entry of
the error log. Thus, the interface will be;

int tracefs_add_dynamic_event(const char *command, char **error_log);

And the usage will be;

ret = tracefs_add_dynamic_event(command, &error_buf);
if (ret < 0) {
	pr_error("Failed to add dynamic event: %d\n", ret);
	pr_error("Error log:\n%s\n", error_buf);
	free(error_buf);
	return ret;
}
...
This is because error_log file keeps some previous error logs and
you need to find appropriate one from the actual command.

Maybe a part of perf probe (util/probe-file.c) should be shared with
libtracefs and finally it should moved on the libtracefs.

Thank you,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ