Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbdHXEYw (ORCPT ); Thu, 24 Aug 2017 00:24:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbdHXEYv (ORCPT ); Thu, 24 Aug 2017 00:24:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D4083683C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=chuhu@redhat.com Date: Thu, 24 Aug 2017 00:24:50 -0400 (EDT) From: Chunyu Hu Reply-To: Chunyu Hu To: Steven Rostedt Cc: mingo@kernel.org, linux-kernel@vger.kernel.org Message-ID: <892710688.893052.1503548690889.JavaMail.zimbra@redhat.com> In-Reply-To: <20170823221541.7aff7912@gandalf.local.home> References: <1502705898-27571-1-git-send-email-chuhu@redhat.com> <1502705898-27571-2-git-send-email-chuhu@redhat.com> <20170823103836.584a5dc5@gandalf.local.home> <20170823104155.27f7c6f6@gandalf.local.home> <20170823125249.102d0908@gandalf.local.home> <951946349.836645.1503529083300.JavaMail.zimbra@redhat.com> <20170823221541.7aff7912@gandalf.local.home> Subject: Re: [PATCH 2/2] tracing: Fix kmemleak in set_trigger_filter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.66.12.107, 10.4.195.27] Thread-Topic: tracing: Fix kmemleak in set_trigger_filter Thread-Index: R+3vG76ucXdLb10iCG/E9lByBRRczw== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 24 Aug 2017 04:24:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1900 Lines: 54 ----- Original Message ----- > From: "Steven Rostedt" > To: "Chunyu Hu" > Cc: mingo@kernel.org, linux-kernel@vger.kernel.org > Sent: Thursday, August 24, 2017 10:15:41 AM > Subject: Re: [PATCH 2/2] tracing: Fix kmemleak in set_trigger_filter > > On Wed, 23 Aug 2017 18:58:03 -0400 (EDT) > Chunyu Hu wrote: > > > ----- Original Message ----- > > > From: "Steven Rostedt" > > > To: "Chunyu Hu" > > > Cc: mingo@kernel.org, linux-kernel@vger.kernel.org > > > Sent: Wednesday, August 23, 2017 12:52:49 PM > > > Subject: Re: [PATCH 2/2] tracing: Fix kmemleak in set_trigger_filter > > > > > > On Wed, 23 Aug 2017 10:41:55 -0400 > > > Steven Rostedt wrote: > > > > > > > * On success, returns 0 and *@filterp points to the new filter. On > > > > * failure, returns -errno and *@filterp may point to %NULL or to a new > > > > * filter. In the latter case, the returned filter contains error > > > > * information if @set_str is %true and the caller is responsible for > > > > * freeing it. > > > > > > > > So filter contains an error string when it fails. It seems that we > > > > should somehow propagate that up the chain to display. I'll look more > > > > into this. > > > > > > The bug is in create_filter(), because "set_str" is set to false, and > > > the filter should not be passed back allocated on error. > > > > Thanks for all the analysis. I think you are right. I'll try to have a test > > on it > > in case we miss something. But please don't block on my test. > > > > My tests are almost done, but I wont send anything till tomorrow. I can > wait a day to post. There's a few other changes I need to send to Linus > as well. Tested with your patch, I did not hit the leak issue and other kmemleak. Thanks. > > -- Steve > -- Regards, Chunyu Hu