From: Greg Kroah-Hartman Date: Tue, 13 May 2014 23:30:12 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.4.91~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd0aba45a5c785cd96739dc6a26d6ff186596909;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: tools-lib-traceevent-fix-memory-leak-in-pretty_print.patch --- diff --git a/queue-3.14/series b/queue-3.14/series index e9009d9ba58..1fc08cb0d37 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -2,3 +2,4 @@ scsi-fix-our-current-target-reap-infrastructure.patch scsi-dual-scan-thread-bug-fix.patch scsi-megaraid-missing-bounds-check-in-mimd_to_kioc.patch kvm-x86-remove-warn_on-from-get_kernel_ns.patch +tools-lib-traceevent-fix-memory-leak-in-pretty_print.patch diff --git a/queue-3.14/tools-lib-traceevent-fix-memory-leak-in-pretty_print.patch b/queue-3.14/tools-lib-traceevent-fix-memory-leak-in-pretty_print.patch new file mode 100644 index 00000000000..2ac7a8d1d8c --- /dev/null +++ b/queue-3.14/tools-lib-traceevent-fix-memory-leak-in-pretty_print.patch @@ -0,0 +1,36 @@ +From de04f8657de9d3351a2d5880f1f7080b23b798cf Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Tue, 22 Apr 2014 19:23:30 -0400 +Subject: tools lib traceevent: Fix memory leak in pretty_print() + +From: Steven Rostedt + +commit de04f8657de9d3351a2d5880f1f7080b23b798cf upstream. + +Commit 12e55569a244 "tools lib traceevent: Use helper trace-seq in print +functions like kernel does" added a extra trace_seq helper to process +string arguments like the kernel does it. But the difference between the +kernel and the userspace library is that the kernel's trace_seq structure +has a static allocated buffer. The userspace one has a dynamically +allocated one. It requires a trace_seq_destroy(), otherwise it produces +a nasty memory leak. + +Signed-off-by: Steven Rostedt +Link: http://lkml.kernel.org/r/20140422192330.6bb09bf8@gandalf.local.home +Signed-off-by: Jiri Olsa +Signed-off-by: Greg Kroah-Hartman + +--- + tools/lib/traceevent/event-parse.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/tools/lib/traceevent/event-parse.c ++++ b/tools/lib/traceevent/event-parse.c +@@ -4321,6 +4321,7 @@ static void pretty_print(struct trace_se + format, len_arg, arg); + trace_seq_terminate(&p); + trace_seq_puts(s, p.buffer); ++ trace_seq_destroy(&p); + arg = arg->next; + break; + default: