Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1519370ybl; Thu, 22 Aug 2019 16:18:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqycua8bP3fMhJKFJEJJmFAd8mG931WOa/S6Hw8U7b9sHvTXx1dhBHSnVx4LzQSpbyIzef3b X-Received: by 2002:a63:7a01:: with SMTP id v1mr1456603pgc.310.1566515885576; Thu, 22 Aug 2019 16:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566515885; cv=none; d=google.com; s=arc-20160816; b=JC6eiouakwUYrRSZ8U8seZM6F0O8auXW581krG9Gy6o7aL8lyJHaAHk9RCqqmwjAhR caqOOj5JcrB1bIbxb0DIPtedwqzfRN+Zf4drbpjsJOkg8eKbh3pzN7uzHhj7Hntn24HA l3ma1BwVeDv3af8SdQDi5HW2yAbWS96Px+8JEbCBpP9azbMIVXeI3Qix0P6k6DtiukKk RMfy39ZmvZdypOtQLM48SBd2tQqtjrr5M7RYZjEiLmXacoUTAGKUp4qVnOUDy3vQhO9O 7Rs76Gs3/esZK/TXDCyHNTimVbsfWtSO9qaGosX8Zl62q4lM+DfLBq4J/gaExbKVGd5N UPrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BJA7FEMhkEeQNvc0PRx6W1SR+/seuNcD5ZdKM+HWMyE=; b=p3eVEvck+XcZerx3eP1MYV94JmLNwxxWtJINDKHnXZCS7hf2jnmKVt2CGcKGUb1kfF +efjc07J3rHr57qFmbGezqGXfAarL2f1rmwLf+zIhjpcnzt/qN36SvD9PxdQIPj4Nau/ YZ5MR6PqFEu63s5uGyEy8cSHESymRh04KIuf838ueQReVozhE90M+TVOcsb6D0k/m8Gi gYCDLdSZJOLUb35jBJXuOv1bpundb2SMc8DcjlM1d6mmn2j47EpvDsYozYgd6DYA89ek gZH6grhmtAKoXVcQGXHlkc+ypGMBe1jF4ZxNSR8t9vryZJU80HzbPtcXM8KaVLOf2zAc wLTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q7rRFMRd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f6si851399pjw.43.2019.08.22.16.17.50; Thu, 22 Aug 2019 16:18:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q7rRFMRd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2391048AbfHVROI (ORCPT + 99 others); Thu, 22 Aug 2019 13:14:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:58944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390570AbfHVRIz (ORCPT ); Thu, 22 Aug 2019 13:08:55 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16C0F23407; Thu, 22 Aug 2019 17:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493734; bh=s4vO960xaF/WXh1KYwGXEgeKkh5fC0qCzFj6uInBGGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q7rRFMRdftAUCHpkOvri5bvTEChBYK75lgSwKA9RYH2um/mEPu/Zm/AJK0RajR+fn sgfLrtTsnk+YQV2d91OiEyM6rZ/v+cC+7+ijvinXVE0KSn9kaqs9LU96SGbAa2sofH 8ddyYeMySENlwVSoZZZ6Eypo5LrYlbEFl6FLgG6M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Masami Hiramatsu , Naresh Kamboju , Will Deacon , Sasha Levin Subject: [PATCH 5.2 073/135] arm64: unwind: Prohibit probing on return_address() Date: Thu, 22 Aug 2019 13:07:09 -0400 Message-Id: <20190822170811.13303-74-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu [ Upstream commit ee07b93e7721ccd5d5b9fa6f0c10cb3fe2f1f4f9 ] Prohibit probing on return_address() and subroutines which is called from return_address(), since the it is invoked from trace_hardirqs_off() which is also kprobe blacklisted. Reported-by: Naresh Kamboju Signed-off-by: Masami Hiramatsu Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/return_address.c | 3 +++ arch/arm64/kernel/stacktrace.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/kernel/return_address.c b/arch/arm64/kernel/return_address.c index b21cba90f82dd..491184a9f0812 100644 --- a/arch/arm64/kernel/return_address.c +++ b/arch/arm64/kernel/return_address.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -29,6 +30,7 @@ static int save_return_addr(struct stackframe *frame, void *d) return 0; } } +NOKPROBE_SYMBOL(save_return_addr); void *return_address(unsigned int level) { @@ -52,3 +54,4 @@ void *return_address(unsigned int level) return NULL; } EXPORT_SYMBOL_GPL(return_address); +NOKPROBE_SYMBOL(return_address); diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 62d395151abe6..cd7dab54d17b3 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) return 0; } +NOKPROBE_SYMBOL(unwind_frame); void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, int (*fn)(struct stackframe *, void *), void *data) @@ -87,6 +89,7 @@ void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, break; } } +NOKPROBE_SYMBOL(walk_stackframe); #ifdef CONFIG_STACKTRACE struct stack_trace_data { -- 2.20.1