]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix possible double free on failure of allocating trace buffer
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 27 Dec 2017 01:07:34 +0000 (20:07 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 27 Dec 2017 19:21:27 +0000 (14:21 -0500)
commitb614f7e500514a44999a04a29dfcf1d3645040b5
treef19586c8935eb246577a72637c12378bf10fede1
parent4d6114d830a09aecd26702d1e6e817ec661ff1f9
tracing: Fix possible double free on failure of allocating trace buffer

Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
tracing buffer, memory is freed, but the pointers that point to them are not
initialized back to NULL, and later paths may try to free the freed memory
again. Jing and Chunyan fixed one of the locations that does this, but
missed a spot.

Link: http://lkml.kernel.org/r/20171226071253.8968-1-chunyan.zhang@spreadtrum.com
Cc: stable@vger.kernel.org
Fixes: 0ae00c76410d2 ("tracing: Consolidate buffer allocation code")
Reported-by: Jing Xia <jing.xia@spreadtrum.com>
Reported-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c