Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5175333pxj; Wed, 26 May 2021 04:48:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu+LDGO1NXPFe0HrVrRqgAmTLFR+xcBsnG21SPHBoWQUXaYV9nfciq4NYwT8gl1QnoqacA X-Received: by 2002:a92:ca0e:: with SMTP id j14mr23156651ils.271.1622029704590; Wed, 26 May 2021 04:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622029704; cv=none; d=google.com; s=arc-20160816; b=iAyFXPuLAiCnripUq8zC7GRVolOGkK1qvOO8GBsTMammotqhdq9u/Dl+EOBSmh8u// +WnKjirlGS7aOrB8wM375vXAMTpqQbdt9U1b8PTDDBbVZ/x/qCocHY8T9UQuflOzSpVr YcfsIYAJ4NrdfdVgqkp7ctVIE5VTAT4trsDfcaUK2Vbki5tKjyyN1ZC2OLwxjO5QiqU4 GLWbmJ8XszJkEXbJ/vjWmYXWaE3m2S7O6cQP6rXc2+9JX2rC9ipRGsVy0Fn8NAEkVzF0 30t0Oyvh6uBOJnt77uiEXSZn2C6V2tY0kuq5iyBEufG3KbzptZmRpm4nX2eLsj0ckWJa cyKw== 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=Bn9x1PabgXFoKDWON1E4g8azQmQW1zbNPAhJkxCHhj6VuIuwc584TvULDjC616Lw67 bcvcfaHokavGNtAzCxngXAHFroCx2e/CQTlkKlSqegOCziZC7KnGExibaAjblOfDkGA5 aB4iD95RzHHMd1ni50P6C1RU2SaIQXcPGdxlk+xulX3zZrtSp0LQdNZCKeo5PSCwond3 mJRSfLnx4c+DaLE9/t6rIIwwmpkK4eMFVQYIGqa+jI23cwtd4II9pnS/8pQduEKUT6fi y8XUC12a6oGB4Fr3YVqoV70M38fh1Oontp7vpmxPl7vkXcLwIM1Bd4Z/KXaoj1tGdcc9 +1ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kkbZNFAl; 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 q4si21355411ilv.82.2021.05.26.04.48.07; Wed, 26 May 2021 04:48:24 -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=kkbZNFAl; 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 S233226AbhEZIFH (ORCPT + 99 others); Wed, 26 May 2021 04:05:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbhEZIFG (ORCPT ); Wed, 26 May 2021 04:05:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18DCF613E6; Wed, 26 May 2021 08:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622016215; bh=KJfN3dfQ7CgYxygr2eqTq1OdnbRKmnmwZLg3RsPDjzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kkbZNFAlElCzi6LGQjjUJQU/iCNABwBGAgnA/kH6P9ZdVZD/h7NnkSZaimEUKHkJS OxLR8zNwBfaLPF10N38fRqWvzy6IeSpVybUsnABMZ7/PVSykXDB5t/pjQNQOpBfXJD rKXnCovY/UFLuYkbpH8WWb0Xn5rJ+ZCacSbVADDGA9umdIMAmyjgFZzfAuy6h23lnL n5/2CMpdMd3xAuf5N2boJpUawDOQNLSv1K3EMEhGPShTiWoGfaHcOuvcrSFF7Qb8aP 7o+jVfujFLtL0mgziFzeOvB4vT/AC1DFeKhWcxCiqaFablB2Vdv3GgKi9Tga5m+dvc RheKmaiYbixAQ== 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 v6 08/13] arm: kprobes: Make a space for regs->ARM_pc at kretprobe_trampoline Date: Wed, 26 May 2021 17:03:31 +0900 Message-Id: <162201621112.278331.7300612749929513135.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162201612941.278331.5293566981784464165.stgit@devnote2> References: <162201612941.278331.5293566981784464165.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