Skip to content

Commit

Permalink
tracepoints: fix disable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mathieu Desnoyers authored and Ingo Molnar committed Nov 16, 2008
1 parent 2504ea5 commit de0baf9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/tracepoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit de0baf9

Please sign in to comment.