Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601AbcJWLn1 (ORCPT ); Sun, 23 Oct 2016 07:43:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756575AbcJWLnZ (ORCPT ); Sun, 23 Oct 2016 07:43:25 -0400 Date: Sun, 23 Oct 2016 13:43:20 +0200 From: Jiri Olsa To: =?iso-8859-1?Q?J=E9r=E9mie?= Galarneau , Philippe Proulx Cc: linux-kernel@vger.kernel.org, Wang Nan , "David S . Miller" , Alexei Starovoitov , Brendan Gregg , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li , pi3orama@163.com Subject: Re: [PATCH] Fix: perf data convert: leak of bt_ctf_field_type Message-ID: <20161023114320.GA12538@krava> References: <20161022195727.13209-1-jeremie.galarneau@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161022195727.13209-1-jeremie.galarneau@efficios.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 23 Oct 2016 11:43:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2074 Lines: 57 On Sat, Oct 22, 2016 at 03:57:27PM -0400, J?r?mie Galarneau wrote: > The ctf_writer structure contains an union of a structure containing > 7 pointer members and an array of 6 struct bt_ctf_field_type*, which > are used to release the references to these objects in > ctf_writer__cleanup_data(). > > 26812d46 introduced the u32_hex member and should have increased the > array's size. The disparity results in the last member of the "data" > structure being leaked as its reference is never released/put. this actualy looks like good solution, sry we missed that first time Could one of you guys please resend that? thanks, jirka > > Philippe Proulx proposed a patch back in February which hasn't received > any feedback and would eliminate the need to manually update this > array. > http://lkml.iu.edu/hypermail/linux/kernel/1602.1/03800.html > > CC-ing the people who were CC-ed on the original patch. > > Signed-off-by: J?r?mie Galarneau > Cc: Wang Nan > Cc: Philippe Proulx > Cc: David S. Miller > Cc: Alexei Starovoitov > Cc: Brendan Gregg > Cc: David S. Miller > Cc: Jiri Olsa > Cc: Masami Hiramatsu > Cc: Namhyung Kim > Cc: Zefan Li > Cc: pi3orama@163.com > --- > tools/perf/util/data-convert-bt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c > index 7123f4d..16364f0 100644 > --- a/tools/perf/util/data-convert-bt.c > +++ b/tools/perf/util/data-convert-bt.c > @@ -67,7 +67,7 @@ struct ctf_writer { > struct bt_ctf_field_type *u32_hex; > struct bt_ctf_field_type *u64_hex; > }; > - struct bt_ctf_field_type *array[6]; > + struct bt_ctf_field_type *array[7]; > } data; > struct bt_ctf_event_class *comm_class; > struct bt_ctf_event_class *exit_class; > -- > 2.10.1 >