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: <CAEf4BzaQr1ruCh1beyhJ_i+aGuw4rGSftF_Zr5ZB=8Jim1jyyQ@mail.gmail.com>
Date: Fri, 24 Jan 2025 09:59:37 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: x86@...nel.org, Peter Zijlstra <peterz@...radead.org>, 
	Steven Rostedt <rostedt@...dmis.org>, Ingo Molnar <mingo@...nel.org>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, linux-kernel@...r.kernel.org, 
	Indu Bhagat <indu.bhagat@...cle.com>, Mark Rutland <mark.rutland@....com>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>, 
	Adrian Hunter <adrian.hunter@...el.com>, linux-perf-users@...r.kernel.org, 
	Mark Brown <broonie@...nel.org>, linux-toolchains@...r.kernel.org, 
	Jordan Rome <jordalgo@...a.com>, Sam James <sam@...too.org>, linux-trace-kernel@...r.kernel.org, 
	Jens Remus <jremus@...ux.ibm.com>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, 
	Florian Weimer <fweimer@...hat.com>, Andy Lutomirski <luto@...nel.org>, 
	Masami Hiramatsu <mhiramat@...nel.org>, Weinan Liu <wnliu@...gle.com>
Subject: Re: [PATCH v4 12/39] unwind_user: Add frame pointer support

On Tue, Jan 21, 2025 at 6:32 PM Josh Poimboeuf <jpoimboe@...nel.org> wrote:
>
> Add optional support for user space frame pointer unwinding.  If
> supported, the arch needs to enable CONFIG_HAVE_UNWIND_USER_FP and
> define ARCH_INIT_USER_FP_FRAME.
>
> By encoding the frame offsets in struct unwind_user_frame, much of this
> code can also be reused for future unwinder implementations like sframe.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---
>  arch/Kconfig                      |  4 +++
>  include/asm-generic/unwind_user.h |  9 ++++++
>  include/linux/unwind_user_types.h |  1 +
>  kernel/unwind/user.c              | 49 +++++++++++++++++++++++++++++--
>  4 files changed, 60 insertions(+), 3 deletions(-)
>  create mode 100644 include/asm-generic/unwind_user.h
>

Do you plan to reuse this logic for stack unwinding done by perf
subsystem in perf_callchain_user()? See is_uprobe_at_func_entry()
parts and also fixup_uretprobe_trampoline_entries() for some of the
quirks that have to be taken into account when doing frame
pointer-based unwinding. It would be great not to lose those in this
new reimplementation.

Not sure what's the best way to avoid duplicating the logic, but I
thought I'd bring that up.

> diff --git a/arch/Kconfig b/arch/Kconfig
> index c6fa2b3ecbc6..cf996cbb8142 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -438,6 +438,10 @@ config HAVE_HARDLOCKUP_DETECTOR_ARCH
>  config UNWIND_USER
>         bool
>
> +config HAVE_UNWIND_USER_FP
> +       bool
> +       select UNWIND_USER
> +
>  config AS_SFRAME
>         def_bool $(as-instr,.cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc)
>

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ