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>] [day] [month] [year] [list]
Date:   Thu, 22 Sep 2022 10:57:11 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Tomislav Novak <tnovak@...com>
Cc:     Will Deacon <will@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] ARM: perf: Fix stacktraces for tracepoint events in
 THUMB2 kernels

On Wed, Sep 21, 2022 at 1:19 AM Tomislav Novak <tnovak@...com> wrote:

> Store the frame address where arm_get_current_stackframe() looks for it
> (ARM_r7 instead of ARM_fp if CONFIG_THUMB2_KERNEL=y). Otherwise frame->fp
> gets set to 0, causing unwind_frame() to fail.
>
>   # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
>   Attaching 1 probe...
>   @[
>       __schedule+1059
>   ]: 1
>
> A typical first unwind instruction is 0x97 (SP = R7), so after executing
> it SP ends up being 0 and -URC_FAILURE is returned.
>
>   unwind_frame(pc = ac9da7d7 lr = 00000000 sp = c69bdda0 fp = 00000000)
>   unwind_find_idx(ac9da7d7)
>   unwind_exec_insn: insn = 00000097
>   unwind_exec_insn: fp = 00000000 sp = 00000000 lr = 00000000 pc = 00000000
>
> With this patch:
>
>   # bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
>   Attaching 1 probe...
>   @[
>       __schedule+1059
>       __schedule+1059
>       schedule+79
>       schedule_hrtimeout_range_clock+163
>       schedule_hrtimeout_range+17
>       ep_poll+471
>       SyS_epoll_wait+111
>       sys_epoll_pwait+231
>       __ret_fast_syscall+1
>   ]: 1
>
> Signed-off-by: Tomislav Novak <tnovak@...com>

Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Can you put this patch into Russell's patch tracker please?
https://www.armlinux.org.uk/developer/patches/

BTW: what is this interesting CONFIG_THUMB2_KERNEL target
that Facebook/Meta is working on? (It's OK if you can't tell, just
curious.)

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ