lkml.org 
[lkml]   [2017]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[for-next][PATCH 3/3] ftrace: Test for NULL iter->tr in regex for stack_trace_filter changes
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

\
 
 \ /
  Last update: 2017-07-06 14:30    [W:0.038 / U:3.152 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site