From patchwork Thu May 27 06:40:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 12283549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1AEFC47089 for ; Thu, 27 May 2021 06:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90BE9613D4 for ; Thu, 27 May 2021 06:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234629AbhE0GmD (ORCPT ); Thu, 27 May 2021 02:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234451AbhE0Gl4 (ORCPT ); Thu, 27 May 2021 02:41:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF85F613CC; Thu, 27 May 2021 06:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622097624; bh=KJfN3dfQ7CgYxygr2eqTq1OdnbRKmnmwZLg3RsPDjzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvmUgiThXObXnaZ1DON9V9l0PJJQnVdkOp0CrIArBUon9XndgzFYA+pfZK0RE7lP8 +jdBGHDvECpHx20E20pcHA7PaQKICJTHvLT/YGcpZVeC+6zP6kRTpUaaN4aAMi11y2 Uu/6gOrbQ5u0mKTa/QA4oXlU1tsb64xlA2AcrDHNa29R1/kFLnu2pm2emEWMJxakjg qtcRd9/hKEWu6ZmyKSnYaDFHxZbWntN8eU9c2zwAUGZx8B9Rbk2ibh/zs96wm2jFkX /aZljN5+buMVGPKilafwU9enoL7GykBQ3PU8SlseT0gjfVfP4P6VFgAr7L9kKjW/ZR coELu1vVAi0wg== From: Masami Hiramatsu To: Steven Rostedt , Ingo Molnar Cc: X86 ML , Masami Hiramatsu , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, tglx@linutronix.de, kernel-team@fb.com, yhs@fb.com, Josh Poimboeuf , linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko Subject: [PATCH -tip v7 08/13] arm: kprobes: Make a space for regs->ARM_pc at kretprobe_trampoline Date: Thu, 27 May 2021 15:40:20 +0900 Message-Id: <162209761982.436794.14123705787131288439.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162209754288.436794.3904335049560916855.stgit@devnote2> References: <162209754288.436794.3904335049560916855.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Change kretprobe_trampoline to make a space for regs->ARM_pc so that kretprobe_trampoline_handler can call instruction_pointer_set() safely. Signed-off-by: Masami Hiramatsu --- arch/arm/probes/kprobes/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c index 1782b41df095..5f3c2b42787f 100644 --- a/arch/arm/probes/kprobes/core.c +++ b/arch/arm/probes/kprobes/core.c @@ -397,11 +397,13 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, void __naked __kprobes kretprobe_trampoline(void) { __asm__ __volatile__ ( + "sub sp, sp, #16 \n\t" "stmdb sp!, {r0 - r11} \n\t" "mov r0, sp \n\t" "bl trampoline_handler \n\t" "mov lr, r0 \n\t" "ldmia sp!, {r0 - r11} \n\t" + "add sp, sp, #16 \n\t" #ifdef CONFIG_THUMB2_KERNEL "bx lr \n\t" #else