linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Will Deacon <will@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.19 22/32] arm64: unwind: Prohibit probing on return_address()
Date: Tue,  6 Aug 2019 17:35:10 -0400	[thread overview]
Message-ID: <20190806213522.19859-22-sashal@kernel.org> (raw)
In-Reply-To: <20190806213522.19859-1-sashal@kernel.org>

From: Masami Hiramatsu <mhiramat@kernel.org>

[ 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 <naresh.kamboju@linaro.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 933adbc0f654d..0311fe52c8ffb 100644
--- a/arch/arm64/kernel/return_address.c
+++ b/arch/arm64/kernel/return_address.c
@@ -11,6 +11,7 @@
 
 #include <linux/export.h>
 #include <linux/ftrace.h>
+#include <linux/kprobes.h>
 
 #include <asm/stack_pointer.h>
 #include <asm/stacktrace.h>
@@ -32,6 +33,7 @@ static int save_return_addr(struct stackframe *frame, void *d)
 		return 0;
 	}
 }
+NOKPROBE_SYMBOL(save_return_addr);
 
 void *return_address(unsigned int level)
 {
@@ -55,3 +57,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 4989f7ea1e599..bb482ec044b61 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/ftrace.h>
+#include <linux/kprobes.h>
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
 #include <linux/sched/task_stack.h>
@@ -85,6 +86,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)
@@ -99,6 +101,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


  parent reply	other threads:[~2019-08-06 21:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 21:34 [PATCH AUTOSEL 4.19 01/32] clk: at91: generated: Truncate divisor to GENERATED_MAX_DIV + 1 Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 02/32] clk: sprd: Select REGMAP_MMIO to avoid compile errors Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 03/32] clk: renesas: cpg-mssr: Fix reset control race condition Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 04/32] xtensa: fix build for cores with coprocessors Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 05/32] xen/pciback: remove set but not used variable 'old_state' Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 06/32] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 07/32] irqchip/irq-imx-gpcv2: Forward irq type to parent Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 08/32] perf header: Fix divide by zero error if f_header.attr_size==0 Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 09/32] perf header: Fix use of unitialized value warning Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 10/32] libata: zpodd: Fix small read overflow in zpodd_get_mech_type() Sasha Levin
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 11/32] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 12/32] Btrfs: fix deadlock between fiemap and transaction commits Sasha Levin
2019-08-07  9:47   ` David Sterba
2019-08-07 10:51     ` Greg KH
2019-08-07 12:44       ` David Sterba
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 13/32] scsi: hpsa: correct scsi command status issue after reset Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 14/32] scsi: qla2xxx: Fix possible fcport null-pointer dereferences Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 15/32] exit: make setting exit_state consistent Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 16/32] drm/amdgpu: fix a potential information leaking bug Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 17/32] ata: libahci: do not complain in case of deferred probe Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 18/32] kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 19/32] kbuild: Check for unknown options with cc-option usage in Kconfig and clang Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 20/32] arm64/efi: fix variable 'si' set but not used Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 21/32] drm/vgem: fix cache synchronization on arm/arm64 Sasha Levin
2019-08-06 21:35 ` Sasha Levin [this message]
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 23/32] arm64/mm: fix variable 'pud' set but not used Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 24/32] IB/core: Add mitigation for Spectre V1 Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 25/32] IB/mlx5: Fix MR registration flow to use UMR properly Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 26/32] IB/mad: Fix use-after-free in ib mad completion handling Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 27/32] drm: msm: Fix add_gpu_components Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 28/32] drm/exynos: fix missing decrement of retry counter Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 29/32] Revert "kmemleak: allow to coexist with fault injection" Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 30/32] ocfs2: remove set but not used variable 'last_hash' Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 31/32] coredump: split pipe command whitespace before expanding template Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 32/32] asm-generic: fix -Wtype-limits compiler warnings Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190806213522.19859-22-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).