]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix possible double free in event_enable_trigger_func()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 25 Jul 2018 20:02:06 +0000 (16:02 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 26 Jul 2018 01:25:16 +0000 (21:25 -0400)
commitb6174ee3b33088a958979147645252055d1d3627
treeac88f89ead2ac9f6f04679e59776a400e8c98146
parenta95f0107b89476b368b229ce00a6139bfcf50a32
tracing: Fix possible double free in event_enable_trigger_func()

There was a case that triggered a double free in event_trigger_callback()
due to the called reg() function freeing the trigger_data and then it
getting freed again by the error return by the caller. The solution there
was to up the trigger_data ref count.

Code inspection found that event_enable_trigger_func() has the same issue,
but is not as easy to trigger (requires harder to trigger failures). It
needs to be solved slightly different as it needs more to clean up when the
reg() function fails.

Link: http://lkml.kernel.org/r/20180725124008.7008e586@gandalf.local.home
Cc: stable@vger.kernel.org
Fixes: e282c4c53d6f3 ("tracing: Add 'enable_event' and 'disable_event' event trigger commands")
Reivewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_trigger.c