tracing: Protect tracer flags with trace_types_lock
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Thu, 14 Mar 2013 17:50:56 +0000 (13:50 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 27 Mar 2013 02:41:14 +0000 (02:41 +0000)
commit06eec6023ca72dbb5c5e3732feb2947ef699d1f5
tree01b550092c618d9b121a7af888027f7abef7bd5d
parent1e6cd6bdd31e809cf307be7239f0aacdf9f09544
tracing: Protect tracer flags with trace_types_lock

commit 69d34da2984c95b33ea21518227e1f9470f11d95 upstream.

Seems that the tracer flags have never been protected from
synchronous writes. Luckily, admins don't usually modify the
tracing flags via two different tasks. But if scripts were to
be used to modify them, then they could get corrupted.

Move the trace_types_lock that protects against tracers changing
to also protect the flags being set.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[bwh: Backported to 3.2: also move failure return in
 tracing_trace_options_write() after unlocking]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
kernel/trace/trace.c