public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	stable@vger.kernel.org, Zamir SUN <sztsian@gmail.com>
Subject: [PATCH 1/6] tracing: Call clear_boot_tracer() at lateinit_sync
Date: Thu, 24 Aug 2017 10:21:44 -0400	[thread overview]
Message-ID: <20170824142224.819431070@goodmis.org> (raw)
In-Reply-To: 20170824142143.110862355@goodmis.org

[-- Attachment #1: 0001-tracing-Call-clear_boot_tracer-at-lateinit_sync.patch --]
[-- Type: text/plain, Size: 1334 bytes --]

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The clear_boot_tracer function is used to reset the default_bootup_tracer
string to prevent it from being accessed after boot, as it originally points
to init data. But since clear_boot_tracer() is called via the
init_lateinit() call, it races with the initcall for registering the hwlat
tracer. If someone adds "ftrace=hwlat" to the kernel command line, depending
on how the linker sets up the text, the saved command line may be cleared,
and the hwlat tracer never is initialized.

Simply have the clear_boot_tracer() be called by initcall_lateinit_sync() as
that's for tasks to be called after lateinit.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=196551

Cc: stable@vger.kernel.org
Fixes: e7c15cd8a ("tracing: Added hardware latency tracer")
Reported-by: Zamir SUN <sztsian@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 42b9355033d4..784fb43b2abe 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8407,4 +8407,4 @@ __init static int clear_boot_tracer(void)
 }
 
 fs_initcall(tracer_init_tracefs);
-late_initcall(clear_boot_tracer);
+late_initcall_sync(clear_boot_tracer);
-- 
2.13.2

       reply	other threads:[~2017-08-24 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170824142143.110862355@goodmis.org>
2017-08-24 14:21 ` Steven Rostedt [this message]
2017-08-24 14:21 ` [PATCH 2/6] tracing: Missing error code in tracer_alloc_buffers() Steven Rostedt
2017-08-24 14:21 ` [PATCH 3/6] ring-buffer: Have ring_buffer_alloc_read_page() return error on offline CPU Steven Rostedt
2017-08-24 14:21 ` [PATCH 4/6] ftrace: Check for null ret_stack on profile function graph entry function Steven Rostedt
2017-08-24 14:21 ` [PATCH 5/6] tracing: Fix kmemleak in tracing_map_array_free() Steven Rostedt
2017-08-24 14:21 ` [PATCH 6/6] tracing: Fix freeing of filter in create_filter() when set_str is false 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=20170824142224.819431070@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sztsian@gmail.com \
    --cc=tom.zanussi@linux.intel.com \
    --cc=torvalds@linux-foundation.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