linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [for-next][PATCH 12/16] kprobes: Initialize kprobes at postcore_initcall
Date: Wed, 3 Jul 2019 10:37:15 -0400	[thread overview]
Message-ID: <20190703103715.32579c25@gandalf.local.home> (raw)
In-Reply-To: <20190703102504.13344555@gandalf.local.home>

This would be the official patch:

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: [PATCH] kprobes: Run init_test_probes() later in boot up

It was reported that the moving of the kprobe initialization earlier in the
boot process caused arm64 to crash. This was due to arm64 depending on the
BRK handler being registered first, but the init_test_probes() can be called
before that happens.

By moving the init_test_probes() to later in the boot process, the BRK
handler is now guaranteed to be initialized before init_test_probes() is
called.

Link: http://lkml.kernel.org/r/20190702165008.GC34718@lakrids.cambridge.arm.com

Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/kprobes.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 5471efbeb937..5a6ecd7bfd73 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2235,6 +2235,8 @@ static struct notifier_block kprobe_module_nb = {
 extern unsigned long __start_kprobe_blacklist[];
 extern unsigned long __stop_kprobe_blacklist[];
 
+static bool run_kprobe_tests __initdata;
+
 static int __init init_kprobes(void)
 {
 	int i, err = 0;
@@ -2286,11 +2288,19 @@ static int __init init_kprobes(void)
 	kprobes_initialized = (err == 0);
 
 	if (!err)
-		init_test_probes();
+		run_kprobe_tests = true;
 	return err;
 }
 subsys_initcall(init_kprobes);
 
+static int __init run_init_test_probes(void)
+{
+	if (run_kprobe_tests)
+		init_test_probes();
+	return 0;
+}
+module_init(run_init_test_probes);
+
 #ifdef CONFIG_DEBUG_FS
 static void report_probe(struct seq_file *pi, struct kprobe *p,
 		const char *sym, int offset, char *modname, struct kprobe *pp)
-- 
2.20.1


  reply	other threads:[~2019-07-03 14:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-26 19:18 [for-next][PATCH 00/16] tracing: Updates for the next merge window Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 01/16] ftrace: Make enable and update parameters bool when applicable Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 02/16] x86/ftrace: Make enable parameter bool where applicable Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 03/16] x86/uaccess: Allow access_ok() in irq context if pagefault_disabled Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 04/16] uaccess: Add non-pagefault user-space read functions Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 05/16] tracing/probe: Add ustring type for user-space string Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 06/16] tracing/probe: Support user-space dereference Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 07/16] selftests/ftrace: Add user-memory access syntax testcase Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 08/16] perf-probe: Add user memory access attribute support Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 09/16] tracing: Use correct function name in trace_filter_add_remove_task() comment Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 10/16] uaccess: Add a prototype of non-static __probe_user_read() Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 11/16] tracing/kprobe: Cast user-space address correctly Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 12/16] kprobes: Initialize kprobes at postcore_initcall Steven Rostedt
2019-07-02 16:50   ` Mark Rutland
2019-07-03 13:50     ` Catalin Marinas
2019-07-03 14:02     ` Steven Rostedt
2019-07-03 14:08       ` Catalin Marinas
2019-07-03 14:24         ` Steven Rostedt
2019-07-03 14:25           ` Steven Rostedt
2019-07-03 14:37             ` Steven Rostedt [this message]
2019-07-09 12:51             ` Masami Hiramatsu
2019-07-09 15:18               ` Steven Rostedt
2019-07-09 15:15         ` Steven Rostedt
2019-07-22 12:42           ` Catalin Marinas
2019-07-22 15:00             ` Steven Rostedt
2019-07-22 16:01               ` Catalin Marinas
2019-07-09 12:30       ` Masami Hiramatsu
2019-07-22 12:34         ` Catalin Marinas
2019-05-26 19:18 ` [for-next][PATCH 13/16] tracing/kprobe: Add kprobe_event= boot parameter Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 14/16] tracing: Make a separate config for trace event self tests Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 15/16] tracing/kprobe: Do not run kprobe boot tests if kprobe_event is on cmdline Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 16/16] ftrace: Enable trampoline when rec count returns back to one Steven Rostedt

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=20190703103715.32579c25@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@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).