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: <20201028131909.923504298@goodmis.org>
Date:   Wed, 28 Oct 2020 09:15:44 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     linux-kernel@...r.kernel.org
Cc:     Masami Hiramatsu <mhiramat@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: [RFC][PATCH 2/2] ftrace: Test arguments by adding trace_printk in function tracer

From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>

Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
---
 kernel/trace/trace_functions.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 89c414ce1388..4bd3194540f1 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -129,7 +129,7 @@ static void function_trace_start(struct trace_array *tr)
 
 static void
 function_trace_call(unsigned long ip, unsigned long parent_ip,
-		    struct ftrace_ops *op, struct pt_regs *pt_regs)
+		    struct ftrace_ops *op, struct pt_regs *regs)
 {
 	struct trace_array *tr = op->private;
 	struct trace_array_cpu *data;
@@ -153,6 +153,17 @@ function_trace_call(unsigned long ip, unsigned long parent_ip,
 	if (!atomic_read(&data->disabled)) {
 		local_save_flags(flags);
 		trace_function(tr, ip, parent_ip, flags, pc);
+#ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
+		trace_printk("%pS %lx %lx %lx %lx %lx %lx %lx\n",
+			     (void *)ip,
+			     kernel_stack_pointer(regs),
+			     regs_get_kernel_argument(regs, 0),
+			     regs_get_kernel_argument(regs, 1),
+			     regs_get_kernel_argument(regs, 2),
+			     regs_get_kernel_argument(regs, 3),
+			     regs_get_kernel_argument(regs, 4),
+			     regs_get_kernel_argument(regs, 5));
+#endif
 	}
 	ftrace_test_recursion_unlock(bit);
 	preempt_enable_notrace();
-- 
2.28.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ