tracepoints: fix disable
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Fri, 14 Nov 2008 22:47:42 +0000 (17:47 -0500)
committerIngo Molnar <mingo@elte.hu>
Sun, 16 Nov 2008 08:01:31 +0000 (09:01 +0100)
Impact: fix race

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.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/tracepoint.c

index e96590f..47a7303 100644 (file)
@@ -262,6 +262,7 @@ static void set_tracepoint(struct tracepoint_entry **entry,
 static void disable_tracepoint(struct tracepoint *elem)
 {
        elem->state = 0;
+       rcu_assign_pointer(elem->funcs, NULL);
 }
 
 /**