rpms/kernel/F-12 linux-2.6-frace-fixes.patch, NONE, 1.1 kernel.spec, 1.1854, 1.1855

Dave Jones davej at fedoraproject.org
Sat Oct 10 01:11:52 UTC 2009


Author: davej

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27207

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-frace-fixes.patch 
Log Message:
Backport two critical ftrace fixes.
  ftrace: check for failure for all conversions
  tracing: correct module boundaries for ftrace_release

linux-2.6-frace-fixes.patch:
 b/include/linux/ftrace.h |    2 +-
 b/kernel/trace/ftrace.c  |   11 +++--------
 kernel/trace/ftrace.c    |   12 ++++--------
 3 files changed, 8 insertions(+), 17 deletions(-)

--- NEW FILE linux-2.6-frace-fixes.patch ---
commit 3279ba37db5d65c4ab0dcdee3b211ccb85bb563f
Author: Steven Rostedt <srostedt at redhat.com>
Date:   Wed Oct 7 16:57:56 2009 -0400

    ftrace: check for failure for all conversions
    
    Due to legacy code from back when the dynamic tracer used a daemon,
    only core kernel code was checking for failures. This is no longer
    the case. We must check for failures any time we perform text modifications.
    
    Cc: stable at kernel.org
    Signed-off-by: Steven Rostedt <rostedt at goodmis.org>

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c701476..f136fe5 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1074,14 +1074,9 @@ static void ftrace_replace_code(int enable)
 		failed = __ftrace_replace_code(rec, enable);
 		if (failed) {
 			rec->flags |= FTRACE_FL_FAILED;
-			if ((system_state == SYSTEM_BOOTING) ||
-			    !core_kernel_text(rec->ip)) {
-				ftrace_free_rec(rec);
-				} else {
-				ftrace_bug(failed, rec->ip);
-					/* Stop processing */
-					return;
-				}
+			ftrace_bug(failed, rec->ip);
+			/* Stop processing */
+			return;
 		}
 	} while_for_each_ftrace_rec();
 }
commit e7247a15ff3bbdab0a8b402dffa1171e5c05a8e0
Author: jolsa at redhat.com <jolsa at redhat.com>
Date:   Wed Oct 7 19:00:35 2009 +0200

    tracing: correct module boundaries for ftrace_release
    
    When the module is about the unload we release its call records.
    The ftrace_release function was given wrong values representing
    the module core boundaries, thus not releasing its call records.
    
    Plus making ftrace_release function module specific.
    
    Signed-off-by: Jiri Olsa <jolsa at redhat.com>
    LKML-Reference: <1254934835-363-3-git-send-email-jolsa at redhat.com>
    Cc: stable at kernel.org
    Signed-off-by: Steven Rostedt <rostedt at goodmis.org>

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index cd3d2ab..0b4f97d 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -241,7 +241,7 @@ extern void ftrace_enable_daemon(void);
 # define ftrace_set_filter(buf, len, reset)	do { } while (0)
 # define ftrace_disable_daemon()		do { } while (0)
 # define ftrace_enable_daemon()			do { } while (0)
-static inline void ftrace_release(void *start, unsigned long size) { }
+static inline void ftrace_release_mod(struct module *mod) {}
 static inline int register_ftrace_command(struct ftrace_func_command *cmd)
 {
 	return -EINVAL;
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 46592fe..c701476 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2658,19 +2658,17 @@ static int ftrace_convert_nops(struct module *mod,
 }
 
 #ifdef CONFIG_MODULES
-void ftrace_release(void *start, void *end)
+void ftrace_release_mod(struct module *mod)
 {
 	struct dyn_ftrace *rec;
 	struct ftrace_page *pg;
-	unsigned long s = (unsigned long)start;
-	unsigned long e = (unsigned long)end;
 
-	if (ftrace_disabled || !start || start == end)
+	if (ftrace_disabled)
 		return;
 
 	mutex_lock(&ftrace_lock);
 	do_for_each_ftrace_rec(pg, rec) {
-		if ((rec->ip >= s) && (rec->ip < e)) {
+		if (within_module_core(rec->ip, mod)) {
 			/*
 			 * rec->ip is changed in ftrace_free_rec()
 			 * It should not between s and e if record was freed.
@@ -2702,9 +2700,7 @@ static int ftrace_module_notify(struct notifier_block *self,
 				   mod->num_ftrace_callsites);
 		break;
 	case MODULE_STATE_GOING:
-		ftrace_release(mod->ftrace_callsites,
-			       mod->ftrace_callsites +
-			       mod->num_ftrace_callsites);
+		ftrace_release_mod(mod);
 		break;
 	}
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1854
retrieving revision 1.1855
diff -u -p -r1.1854 -r1.1855
--- kernel.spec	9 Oct 2009 20:16:08 -0000	1.1854
+++ kernel.spec	10 Oct 2009 01:11:47 -0000	1.1855
@@ -740,6 +740,7 @@ Patch12013: linux-2.6-rfkill-all.patch
 Patch12014: linux-2.6-selinux-module-load-perms.patch
 
 # patches headed for -stable
+Patch13000: linux-2.6-frace-fixes.patch
 
 # Raid10 lockdep fix
 Patch14002: linux-2.6-raidlockdep.patch
@@ -1386,6 +1387,7 @@ ApplyPatch linux-2.6-rfkill-all.patch
 ApplyPatch linux-2.6-selinux-module-load-perms.patch
 
 # patches headed for -stable
+ApplyPatch linux-2.6-frace-fixes.patch
 
 # Raid10 lockdep fix
 ApplyPatch linux-2.6-raidlockdep.patch
@@ -2046,6 +2048,11 @@ fi
 # and build.
 
 %changelog
+* Fri Oct 09 2009 Dave Jones <davej at redhat.com>
+- Backport two critical ftrace fixes.
+  ftrace: check for failure for all conversions
+  tracing: correct module boundaries for ftrace_release
+
 * Fri Oct 09 2009 Jarod Wilson <jarod at redhat.com>
 - Build docs sub-package again
 




More information about the fedora-extras-commits mailing list