Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2039045imm; Mon, 16 Jul 2018 00:39:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf+dP4WbibJaFKVwzwMxcqGXeuaQ2fOJ/06+MrC93KYncc8VLSr8bDpM+r1GJEo4lMSB+07 X-Received: by 2002:a17:902:ab90:: with SMTP id f16-v6mr16074788plr.182.1531726790113; Mon, 16 Jul 2018 00:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726790; cv=none; d=google.com; s=arc-20160816; b=Tcoz2hXNzQkoR/BPMVWy+bD/2LTfQ/frOISIlxPnugUKMEpP4ZhsWzD/U+6JZNQm5p Onuttqe82/19xKs57OKTi3wVP3qm+O6kRZuE+u75OmZ0vXkuHEJuUyPS5imQTv5nzpZw dI67TzKpJHMKjsCyY1RhY3ipM8ZVdALissGc2STnI/bDKVatdwlC2UAd2iqZu508nist gEXPSuw7OGHHmFn6SfQd1XFhpBLMcoJdc067+AqIDCP8AY8T9cRdII18Ww3dN6pwYO4W Lp51fwlhrJkyiON8V3SqgJbNCvuTloR2lPFoIC5Cx3+xp8d7ecJy9rbjojrnui9N6IRu Jt1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QxGJ1T/A7CcorLWVJGiW+cSat5DqDZ6poQZtVJ0hh9M=; b=NHGLBrRCCyKHRAJJTxO6IoeOXH7lIV3ZzGEXwuUY/5HMH9e5C0QprxTWqR0GIElZZw l5b1+7n7cuf1uvKNqe5d1NqkT5VaH/gwgqvDyfPpFemGnrGCpT55Fd2Mz/n2faxGJfp/ N+1a/EeknnGZyZuWwrgp0EvD9pBOXJsv28gjQCALXNC+vF+dPaIlpdLcrq3T5DplYGnp QoG7VWc6fProFJY4dzkfMt2s9w0Syw+eWe/quePUcM9UclGzkUe9NwonMMVX9NXZ5WMG JBM8YCrvZsPow9L2KWcUUU4VAIEvPoHJglbR6g25E4bKg+u7f5wMrz6ljsoQTr6LKASr cX5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y29-v6si2436142pga.359.2018.07.16.00.39.35; Mon, 16 Jul 2018 00:39:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731970AbeGPIDr (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46766 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeGPIDr (ORCPT ); Mon, 16 Jul 2018 04:03:47 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F3EF0CA0; Mon, 16 Jul 2018 07:37:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Song Liu , Masami Hiramatsu , Jiri Olsa , "Steven Rostedt (VMware)" Subject: [PATCH 4.17 19/67] tracing/kprobe: Release kprobe print_fmt properly Date: Mon, 16 Jul 2018 09:34:48 +0200 Message-Id: <20180716073446.154544715@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Olsa commit 0fc8c3581dd42bc8f530314ca86db2d861485731 upstream. We don't release tk->tp.call.print_fmt when destroying local uprobe. Also there's missing print_fmt kfree in create_local_trace_kprobe error path. Link: http://lkml.kernel.org/r/20180709141906.2390-1-jolsa@kernel.org Cc: stable@vger.kernel.org Fixes: e12f03d7031a ("perf/core: Implement the 'perf_kprobe' PMU") Acked-by: Song Liu Acked-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_kprobe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1451,8 +1451,10 @@ create_local_trace_kprobe(char *func, vo } ret = __register_trace_kprobe(tk); - if (ret < 0) + if (ret < 0) { + kfree(tk->tp.call.print_fmt); goto error; + } return &tk->tp.call; error: @@ -1472,6 +1474,8 @@ void destroy_local_trace_kprobe(struct t } __unregister_trace_kprobe(tk); + + kfree(tk->tp.call.print_fmt); free_trace_kprobe(tk); } #endif /* CONFIG_PERF_EVENTS */