Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp319423pxj; Thu, 27 May 2021 00:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya2kfaAvN4F/OgSEsoZYJ1lcPkSa0euazpGVXLe1HTQlhyt2TsxYfsKGRzdS6iIuDLeaiO X-Received: by 2002:a5e:8305:: with SMTP id x5mr1747752iom.112.1622100592003; Thu, 27 May 2021 00:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622100591; cv=none; d=google.com; s=arc-20160816; b=WOKdGQIpuwv6kqEfy67AyMBuE4eh5P4XDqBV/KGFjM8bZH+ky4EQ3lmSCQgLOuXOqA nSG3jii3dLKz9QPh5gAhfxPMYnaAYwANXD9Kxkay0MMIy6jS07ny2CPP8M/+kT3eQSnP vA7mHhsoUbFvSrAjlzuXez/5fU1/7i/BwQlkEBnaSIGk1XyyDOI9kelc6axu2SHhNd/l pwWgX7kX1AH110AXFW5SK/nRjsC9ilK4Y75giOJ7UZ8qYS9jvy0gVwrA4OYxu0wTgdIc U/CLaxj4KyXsjw/5hJWEF8VEbxw5o1ir4zBp+FbTSORlWb8DQTBI25OPHv5w5lYJLY2q usNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ozoxJ8eiprTGZ0XFE8A1+V4ILQhnQIYL5IRevO78GUU=; b=xKj5lJIXWLNOaDd716N1yDJkuFkObQmIaiTwCODze7wsOaQgrrU/XU0sGNoZrYH+Cd nhStyd6Plt723V7GM5PTX+gVtk8vyM+Y3eIq9MSv6ixXvycUxPkgv0hEmtmrZs3smqrB b57Otf4zGYjq3etEXpRqjX5yDQHB1evwMa/LZIX0xgGVmP7LFz7K3Szur3rUcpdN23HM Sk6w0tJT9RdHHH4fpmqHfIOJV8xld6Mh6Iz5kV2x1rSiIWBs/dIyspB+lH1oCIuMz8ji U/4YlhE82LSRuFMObJEso48qwyXWIYnynbknD66hyMrSOAdmN1XwA89naYojfRkPZIQX Fs5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UvmUgiTh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si1438282jaj.88.2021.05.27.00.29.33; Thu, 27 May 2021 00:29:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UvmUgiTh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234628AbhE0GmP (ORCPT + 99 others); Thu, 27 May 2021 02:42:15 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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