[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-b00f0b6dc1773b4c8f538503247da050b5ea631b@git.kernel.org>
Date: Fri, 13 Mar 2009 09:33:29 GMT
From: Zhaolei <zhaolei@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
rostedt@...dmis.org, zhaolei@...fujitsu.com, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:tracing/ftrace] ftrace: avoid double-free of dyn_ftrace
Commit-ID: b00f0b6dc1773b4c8f538503247da050b5ea631b
Gitweb: http://git.kernel.org/tip/b00f0b6dc1773b4c8f538503247da050b5ea631b
Author: Zhaolei <zhaolei@...fujitsu.com>
AuthorDate: Fri, 13 Mar 2009 17:14:01 +0800
Commit: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 13 Mar 2009 10:25:06 +0100
ftrace: avoid double-free of dyn_ftrace
If dyn_ftrace is freed before ftrace_release(), ftrace_release()
will free it again and make ftrace_free_records wrong.
Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
Cc: "Steven Rostedt ;" <rostedt@...dmis.org>
LKML-Reference: <49BA23D9.1050900@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/ftrace.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index d33d306..26c45aa 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -356,7 +356,8 @@ void ftrace_release(void *start, unsigned long size)
mutex_lock(&ftrace_lock);
do_for_each_ftrace_rec(pg, rec) {
- if ((rec->ip >= s) && (rec->ip < e))
+ if ((rec->ip >= s) && (rec->ip < e) &&
+ !(rec->flags & FTRACE_FL_FREE))
ftrace_free_rec(rec);
} while_for_each_ftrace_rec();
mutex_unlock(&ftrace_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists