[patch 09/16] Tracepoint fix disable

Mathieu Desnoyers
2008-11-14T23:00:30Z

[-- Attachment #1: tracepoint-fix-disable.patch --]
[-- Type: text/plain, Size: 972 bytes --]

Set the probe array pointer to NULL when the tracepoint is disabled.
The probe array point not being NULL could generate a race condition where the
reader would dereference a freed pointer.

Impact: bugfix.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: 'Ingo Molnar' <mingo@elte.hu>
CC: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/tracepoint.c | 1 +
1 file changed, 1 insertion(+)

Index: linux.trees.git/kernel/tracepoint.c
===================================================================
--- linux.trees.git.orig/kernel/tracepoint.c 2008-11-14 17:39:52.000000000 -0500
+++ linux.trees.git/kernel/tracepoint.c 2008-11-14 17:39:56.000000000 -0500
@@ -262,6 +262,7 @@ static void set_tracepoint(struct tracep
static void disable_tracepoint(struct tracepoint *elem)
{
elem->state = 0;
+ rcu_assign_pointer(elem->funcs, NULL);
}

/**