From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 3/3] ftrace: Test for NULL iter->tr in regex for stack_trace_filter changes
Date: Thu, 06 Jul 2017 08:28:03 -0400 [thread overview]
Message-ID: <20170706122848.493588361@goodmis.org> (raw)
In-Reply-To: <20170706122800.705318130@goodmis.org>
[-- Attachment #1: 0003-ftrace-Test-for-NULL-iter-tr-in-regex-for-stack_trac.patch --]
[-- Type: text/plain, Size: 957 bytes --]
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
As writing into stack_trace_filter, the iter-tr is not set and is NULL.
Check if it is NULL before dereferencing it in ftrace_regex_release().
Fixes: 8c08f0d5c6fb ("ftrace: Have cached module filters be an active filter")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f8c18f15b190..2953d558bbee 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5043,7 +5043,7 @@ int ftrace_regex_release(struct inode *inode, struct file *file)
if (filter_hash) {
orig_hash = &iter->ops->func_hash->filter_hash;
- if (!list_empty(&iter->tr->mod_trace))
+ if (iter->tr && !list_empty(&iter->tr->mod_trace))
iter->hash->flags |= FTRACE_HASH_FL_MOD;
} else
orig_hash = &iter->ops->func_hash->notrace_hash;
--
2.10.2
prev parent reply other threads:[~2017-07-06 12:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 12:28 [for-next][PATCH 0/3] tracing: Last minute updates for 4.13 Steven Rostedt
2017-07-06 12:28 ` [for-next][PATCH 1/3] ftrace: Decrement count for dyn_ftrace_total_info for init functions Steven Rostedt
2017-07-06 12:28 ` [for-next][PATCH 2/3] ftrace: Fix regression with module command in stack_trace_filter Steven Rostedt
2017-07-06 12:28 ` Steven Rostedt [this message]
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=20170706122848.493588361@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®