From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581AbdBNQBe (ORCPT ); Tue, 14 Feb 2017 11:01:34 -0500 Received: from mail.kernel.org ([198.145.29.136]:51786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbdBNQBX (ORCPT ); Tue, 14 Feb 2017 11:01:23 -0500 Date: Wed, 15 Feb 2017 01:01:07 +0900 From: Masami Hiramatsu To: "Jon Medhurst (Tixy)" Cc: Russell King , linux-kernel@vger.kernel.org, Peter Zijlstra , Ananth N Mavinakayanahalli , Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Wang Nan , Catalin Marinas , Will Deacon , "David A . Long" , Sandeepa Prabhu Subject: Re: [BUGFIX PATCH 3/3] kprobes/arm: Fix the return address of multiple kretprobes Message-Id: <20170215010107.8aff7cb6f526502daf094879@kernel.org> In-Reply-To: <1487080027.2978.8.camel@linaro.org> References: <148699813647.8505.3671818093118978038.stgit@devbox> <148699834879.8505.2595570331866285215.stgit@devbox> <1487068371.2978.6.camel@linaro.org> <1487080027.2978.8.camel@linaro.org> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Feb 2017 13:47:07 +0000 "Jon Medhurst (Tixy)" wrote: > On Tue, 2017-02-14 at 10:32 +0000, Jon Medhurst (Tixy) wrote: > > On Tue, 2017-02-14 at 00:05 +0900, Masami Hiramatsu wrote: > > > This is arm port of commit 737480a0d525 ("kprobes/x86: > > > Fix the return address of multiple kretprobes"). > > > > > > Fix the return address of subsequent kretprobes when multiple > > > kretprobes are set on the same function. > > > > > > For example: > > > > > > # cd /sys/kernel/debug/tracing > > > # echo "r:event1 sys_symlink" > kprobe_events > > > # echo "r:event2 sys_symlink" >> kprobe_events > > > # echo 1 > events/kprobes/enable > > > # ln -s /tmp/foo /tmp/bar > > > > > > (without this patch) > > > > > > # cat trace | grep -v ^# > > > ln-82 [000] dn.2 68.446525: event1: (kretprobe_trampoline+0x0/0x18 <- SyS_symlink) > > > ln-82 [000] dn.2 68.447831: event2: (ret_fast_syscall+0x0/0x1c <- SyS_symlink) > > > > > > (with this patch) > > > > > > # cat trace | grep -v ^# > > > ln-81 [000] dn.1 39.463469: event1: (ret_fast_syscall+0x0/0x1c <- SyS_symlink) > > > ln-81 [000] dn.1 39.464701: event2: (ret_fast_syscall+0x0/0x1c <- SyS_symlink) > > > > > > Signed-off-by: Masami Hiramatsu > > > Cc: KUMANO Syuhei > > > --- > > > > I don't fully understand this function, but I've checked that the ARM > > version now matches the x86 version (apart from the x86 specific > > register fixup and some comments). So, FWIW > > > > Acked-by: Jon Medhurst > > > > I ran the before and after test case in the commit log on ARM and > > verified the result is correct. I also tried running the ARM kprobe > > tests with these 3 fixes but the tests fail. However, they also fail > > without any of these changes, so I'll investigate that further... > > Bisecting the issue led me back to Linux 4.5 and commit 25362dc496ed > ("ARM: 8501/1: mm: flip priority of CONFIG_DEBUG_RODATA") > > This sets CONFIG_DEBUG_RODATA to be enabled by default. If I disable > that on 4.10-rc4, with the three patches in this series, then the ARM > kprobes tests pass OK. > > I'll stick the DEBUG_RODATA issue on my todo list (it's been around for > a year, so can probably wait a little longer). Hmm, I'm running arm kernel on qemu, which maybe the reason why the test case passed in my environment, since my kconfig also sets CONFIG_DEBUG_RODATA=y. BTW, would you see that any kprobe_events didn't work with CONFIG_DEBUG_RODATA=y? (what the failure messages were?) Thank you, > > -- > Tixy > -- Masami Hiramatsu