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: <d7b9116e-bddc-2ab2-06eb-6191612fe16b@huawei.com>
Date: Mon, 12 Aug 2024 14:45:40 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
	<namhyung@...nel.org>, <mark.rutland@....com>,
	<alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
	<irogers@...gle.com>, <adrian.hunter@...el.com>, <kan.liang@...ux.intel.com>,
	<will@...nel.org>, <arnd@...db.de>, <afd@...com>, <linus.walleij@...aro.org>,
	<akpm@...ux-foundation.org>, <masahiroy@...nel.org>,
	<eric.devolder@...cle.com>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>
Subject: Re: [PATCH v2] ARM: stacktrace: Add USER_STACKTRACE support



On 2024/8/2 19:48, Russell King (Oracle) wrote:
> On Tue, Jul 30, 2024 at 10:15:32AM +0800, Jinjie Ruan wrote:
>> Currently, userstacktrace is unsupported for ARM. So use the
>> perf_callchain_user() code as blueprint to implement the
>> arch_stack_walk_user() which add userstacktrace support on ARM.
>> Meanwhile, we can use arch_stack_walk_user() to simplify the implementation
>> of perf_callchain_user().
>>
>> A ftrace test case is shown as below:
>> 	# cd /sys/kernel/debug/tracing
>> 	# echo 1 > options/userstacktrace
>> 	# echo 1 > options/sym-userobj
>> 	# echo 1 > events/sched/sched_process_fork/enable
>> 	# cat trace
>>
>> 	......
>> 	              sh-100     [000] .....    51.779261: sched_process_fork: comm=sh pid=100 child_comm=sh child_pid=108
>> 	              sh-100     [000] .....    51.779285: <user stack trace>
>> 	 => /lib/libc.so.6[+0xb3c8c]
>> 	 => /bin/busybox[+0xffb901f1]
>>
>> Also a simple perf test is ok as below:
>> 	# perf record -e cpu-clock --call-graph fp top
>> 	# perf report --call-graph
>>
>> 	.....
>> 	  [[31m  65.00%[[m     0.00%  top      [kernel.kallsyms]  [k] __ret_fast_syscall
>>
>> 	            |
>> 	            ---__ret_fast_syscall
>> 	               |
>> 	               |--[[31m30.00%[[m--__se_sys_getdents64
>> 	               |          iterate_dir
>> 	               |          |
>> 	               |          |--[[31m25.00%[[m--proc_pid_readdir
>>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> 
> Do you have a use case for this feature?

To my knowledge, user stack trace is used in both uprobes and ftrace.

> 
> Given that userspace is free to do whatever it likes with stack frames,
> I think this is going to be hit and miss whether it works.

To be honest, I referred to the implementation of ARM64. Does anyone
have suggestions for improvements or modifications?

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ