From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbdJCO36 (ORCPT ); Tue, 3 Oct 2017 10:29:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:36806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbdJCO35 (ORCPT ); Tue, 3 Oct 2017 10:29:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49E9D21869 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 3 Oct 2017 10:29:54 -0400 From: Steven Rostedt To: Shu Wang Cc: mingo@redhat.com, chuhu@redhat.com, liwang@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ftrace: fix kmemleak in unregister_ftrace_graph Message-ID: <20171003102954.6a7f0f43@gandalf.local.home> In-Reply-To: <1894046657.10455897.1506427286860.JavaMail.zimbra@redhat.com> References: <20170912021454.5976-1-shuwang@redhat.com> <1894046657.10455897.1506427286860.JavaMail.zimbra@redhat.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Sep 2017 08:01:26 -0400 (EDT) Shu Wang wrote: > > From: shuwang@redhat.com > > To: rostedt@goodmis.org, mingo@redhat.com > > Cc: chuhu@redhat.com, liwang@redhat.com, linux-kernel@vger.kernel.org, "Shu Wang" > > Sent: Tuesday, September 12, 2017 10:14:54 AM > > Subject: [PATCH] ftrace: fix kmemleak in unregister_ftrace_graph > > > > From: Shu Wang > > > > The trampoline allocated by function tracer was > > overwrite by function_graph tracer, and cause > > memory leak. The save_global_trampoline should > > save previous trampoline in register_ftrace_graph > > and restore it in unregister_ftrace_graph. But > > as it implemented, save_global_trampoline was only > > used in unregister_ftrace_graph as default value 0, > > and overwrite the previous trampoline's value. > > > > kmmeleak backtrace: > > kmemleak_vmalloc+0x77/0xc0 > > __vmalloc_node_range+0x1b5/0x2c0 > > module_alloc+0x7c/0xd0 > > arch_ftrace_update_trampoline+0xb5/0x290 > > ftrace_startup+0x78/0x210 > > register_ftrace_function+0x8b/0xd0 > > function_trace_init+0x4f/0x80 > > tracing_set_tracer+0xe6/0x170 > > tracing_set_trace_write+0x90/0xd0 > > __vfs_write+0x37/0x170 > > vfs_write+0xb2/0x1b0 > > SyS_write+0x55/0xc0 > > do_syscall_64+0x67/0x180 > > return_from_SYSCALL_64+0x0/0x6a > > > > Signed-off-by: Shu Wang > > > > ping Thanks for the reminder. I pulled it in and will send this out to Linus after the testing finishes. I also marked it for stable. -- Steve