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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 May 2019 23:51:55 +0000
From:   Song Liu <songliubraving@...com>
To:     "kasong@...hat.com" <kasong@...hat.com>,
        lkml <linux-kernel@...r.kernel.org>
CC:     Peter Zijlstra <peterz@...radead.org>,
        Kernel Team <Kernel-team@...com>
Subject: Getting empty callchain from perf_callchain_kernel() 

Hi, 

We found a failure with selftests/bpf/tests_prog in test_stacktrace_map (on bpf/master
branch). 

After digging into the code, we found that perf_callchain_kernel() is giving empty
callchain for tracepoint sched/sched_switch. And it seems related to commit

d15d356887e770c5f2dcf963b52c7cb510c9e42d
("perf/x86: Make perf callchains work without CONFIG_FRAME_POINTER")

Before this commit, perf_callchain_kernel() returns callchain with regs->ip. With
this commit, regs->ip is not sent for !perf_hw_regs(regs) case. 

I found the following change fixes the selftest. But I am not very sure, it is 
the best solution here. 

Please share comments and suggestions on this. 

Thanks in advance!

Song


diff --git i/arch/x86/events/core.c w/arch/x86/events/core.c
index f315425d8468..7b8a9eb4d5fd 100644
--- i/arch/x86/events/core.c
+++ w/arch/x86/events/core.c
@@ -2402,9 +2402,9 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
                return;
        }

+       if (perf_callchain_store(entry, regs->ip))
+               return;
        if (perf_hw_regs(regs)) {
-               if (perf_callchain_store(entry, regs->ip))
-                       return;
                unwind_start(&state, current, regs, NULL);
        } else {
                unwind_start(&state, current, NULL, (void *)regs->sp);



Powered by blists - more mailing lists