From nobody Sat Feb 7 09:42:30 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8E83DDC1 for ; Sun, 12 Jan 2025 03:44:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736653476; cv=none; b=Jg4X2CqBwl08YU1lOD8GxQNPnLU3ygdsqawfqvdvvHp0lGHL0Jvj/97uvN0QVTwZ7koUI6pSgffSIcs+UqeWRmWM1ISBlthjALGBrdJj91/Ejyh8CKbqz83rRx2l4OXAD7rMOQia9xfHRP/ak1swLLmzcwmQUaNKJSeGbIEZA5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736653476; c=relaxed/simple; bh=lZjxzgMdIpWio+Bk1Iod2LWzR9ICd6ZrzU09PlxIGWo=; h=Date:From:To:Cc:Subject:Message-Id:Mime-Version:Content-Type; b=Pd+cf41eMV8T67mLaHR0rIAJMomqHJ4ZNRF0SUnFf0tAqZDGRdpY5PUbDrfMIf2owDnOtncydKbAZO2bY1zDxYoYuRr2J2C5DhNA/mO4VeC7wBCpiVCVP9AWkHwiCPQMLQfAzdMmM6Z4fruFHKNProvU9FHQzBuJ/mfib0iYees= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T0BzI6QM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T0BzI6QM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4AE3C4CEE0; Sun, 12 Jan 2025 03:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736653475; bh=lZjxzgMdIpWio+Bk1Iod2LWzR9ICd6ZrzU09PlxIGWo=; h=Date:From:To:Cc:Subject:From; b=T0BzI6QMGeqYPpfpwf0JKXimz9pvbKvs3fPdsGZptDO+0mEwmKnoHBNkkax2f+JBL 2ArjGi8ns2u+ajwN6bUntkzVjs+gUQqUnBFgurWHuhMl4gjB2XS140nE7w3J8Rp121 tGM/+M0WAONC1hlQ/Id78JAwdQjh80hwFwGqWLBehLarYnv+8yGwSojBHzCIA7C1K1 85351uhT8GOHoQMuyjxRoU8D074JnbDYuID4/DD+VVk8M2shWRhYYk8THiBHyfHbPE n7cwXfidUCqJxP1+6X2WW9rj6dDWLq5emfABV9ZFNMSGj+226x5jj2YNaahVnV0ZLE vRH5Rd/2WzVLA== Date: Sun, 12 Jan 2025 12:44:31 +0900 From: Masami Hiramatsu (Google) To: Linus Torvalds Cc: Masami Hiramatsu (Google) , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [GIT PULL] probes: Fixes for v6.13-rc6 Message-Id: <20250112124431.87bed2765b5387d903b731b9@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Linus, Probes fixes for v6.13-rc6: - tracing/kprobes: Fix to free trace_kprobe objects at a failure path in __trace_kprobe_create() function. This fixes a memory leak. Please pull the latest probes-fixes-v6.13-rc6 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-fixes-v6.13-rc6 Tag SHA1: 34f0f018d7a3ef1a99d316dd0f4854410f6cc8e7 Head SHA1: 30c8fd31c571db486a5331a92d03eb60a0fb277c Masami Hiramatsu (Google) (1): tracing/kprobes: Fix to free objects when failed to copy a symbol ---- kernel/trace/trace_kprobe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --------------------------- commit 30c8fd31c571db486a5331a92d03eb60a0fb277c Author: Masami Hiramatsu (Google) Date: Thu Jan 9 23:29:37 2025 +0900 tracing/kprobes: Fix to free objects when failed to copy a symbol =20 In __trace_kprobe_create(), if something fails it must goto error block to free objects. But when strdup() a symbol, it returns without that. Fix it to goto the error block to free objects correctly. =20 Link: https://lore.kernel.org/all/173643297743.1514810.2408159540454241= 947.stgit@devnote2/ =20 Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework for kpro= be events") Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 935a886af40c..0642ea174849 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -940,8 +940,10 @@ static int __trace_kprobe_create(int argc, const char = *argv[]) } /* a symbol specified */ symbol =3D kstrdup(argv[1], GFP_KERNEL); - if (!symbol) - return -ENOMEM; + if (!symbol) { + ret =3D -ENOMEM; + goto error; + } =20 tmp =3D strchr(symbol, '%'); if (tmp) { --=20 Masami Hiramatsu (Google)