Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp410583lqh; Sat, 4 May 2024 06:19:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/SQelz3puEEtEwgDpM11/QwgXfKyWk2F7GvtFQZztdLIqkoSwYUdeOQoS69bL23ErROEYY0EklDYQyy9iuzD2tgUaKQdrZkYO4zyO5Q== X-Google-Smtp-Source: AGHT+IFDqOv6Ytv6qmala0Y9C8qFIm7RS6ROxxn11KL9lW3wDvLglc/hWahfjC51jGhttOe+NEhT X-Received: by 2002:a05:6a00:2e26:b0:6ed:e1c:102e with SMTP id fc38-20020a056a002e2600b006ed0e1c102emr7102930pfb.24.1714828790093; Sat, 04 May 2024 06:19:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714828790; cv=pass; d=google.com; s=arc-20160816; b=AsqdGGqRWdtsIt55voUqY09iRzbwpEIdgzhPsbwhMZ2WbTosEufSJKeT72r+LgEPbh TBMXtqVAgtu/80DjwiuQLMGoz4Ae+05ehgYIaX9Y4RWlNQ5GEh/6qUanA581bFFNbNZw bQiIyoc3kRCBnmdz150mGLmc6r+Z0j72IDkxrFSbS7kZezeUFHCF2Y62ukDUzJWgO/Fb Se6XhJ355AJ4aAC/c5VTUYQYlgbwB4zKc79TkVnksii1T3/1U19D42wr+O+FUCnu4F23 oUhCD8Hn/uKojvXuXQPYM1P+LtCkQ65MdDTfPIx86x5P/eh6QUv7gW78ugc3qFUM2h+2 SwFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=OKNviKyvZW0899+rS8YD59jvwIfMS5hCb6ky7m0cbN8=; fh=pNFRtI19EwdKZb0TEG2XGK5NcnSYv5Dx8waj3E32yy0=; b=GoB9VecsB+/dglo/87nIeCbzKntabT+gsuB/KdkQBocqkhTiNvt6gUCn+2gDT3vjaB fo4MYRe3uw67ATs2B8m1UAKEFFlzj97c93WdhJoRnoew3fJc7Yvjqn4igoLRS1gR9YIe MV9AEjw+HTTegFKZfsjxL/oYyAEqrcD0n2hTgs4CO3gqCSul+o/dVyi/GXrNLEt70Rs8 NyfCDFmtzXgjVUIuAlUej/2Lr/PBF76fPM+sc/0GeUrxgce19qOwx2pxLNwttjaK+pep 0hVDSBOvNE8ecm0oB2RWqpSBmFGjZ2LMExlcFf9yKunSCOkKH76Geo2xE3kocJ9JikPE TDeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0RripFr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z5-20020aa78885000000b006ed008652b5si4164605pfe.103.2024.05.04.06.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 06:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0RripFr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F0FB8B210DD for ; Sat, 4 May 2024 13:19:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CC7222EE9; Sat, 4 May 2024 13:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e0RripFr" 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 481A7347A2 for ; Sat, 4 May 2024 13:19:20 +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=1714828761; cv=none; b=Qa8TAep7ZcJNEAIasxa3ZpLdX2eUnyulpj7jk/588y39jssJ6Zpj7obTxkpPMtwx9uU9gSzJ6b6huzQTtHlTKen62zUMnfGxPXej2M+9yn5SnOlhZwZ2blK7JgN/ZHUzrtdppJPSHI5o77XBN4YuJWii9ebVN3qBYfQgoFvqH60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714828761; c=relaxed/simple; bh=0iM6ddpSHy9QRibkfi4w6+c5/GvHMDRispgBTIldvY4=; h=Date:From:To:Cc:Subject:Message-Id:Mime-Version:Content-Type; b=LsoNYLE4kPVMAAMH5nMjq3D3ce8Xc1/iA2qGcwfLxsVgPV8jijMh5mtgBadwhiASJOisA5str9Cp/cDg5hKHMFccBq+wfC3aSGNSkjaoCi2WphvfEgJ/RxpcOxNK219XnmAP13gqHIMZooDU5F2db2Cbbs7R2+zVrP/lW/1OAe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e0RripFr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 571B0C072AA; Sat, 4 May 2024 13:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714828760; bh=0iM6ddpSHy9QRibkfi4w6+c5/GvHMDRispgBTIldvY4=; h=Date:From:To:Cc:Subject:From; b=e0RripFrDu5yGApT5MAafPDUvfmk0UOhMkAQ+L4LEyZs5toqPDGuSP4LbAaLsB8iE Ijs2zkAxIvxu9/8Jny/gBiGQw6CpsGRFTUJaqCUW6mki0fZouxydJN7P5QYRLSEaow yb96tCHMh3/KscTGt3Zljv+0glN0WHq6DveRT9ygntCWfWz8Xxrtymbv5BW4vCn+rQ GbN5m1cfzU7KK0bQm0OrPAuby0dp62Cvj0inIbnw6ARLdJzwUQmjdlfV+Yk5VtEKZ3 nyX7F68GEMZ+Wgk9xhv6uroUkzdnKa6UrHGrIbzzG5gblrLMZBEZQ1dzJoa7PrVh5E yULgO7i7Tt3Qw== Date: Sat, 4 May 2024 22:19:17 +0900 From: Masami Hiramatsu (Google) To: Linus Torvalds Cc: LuMingYin , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [GIT PULL] probes: Fixes for v6.9-rc6 Message-Id: <20240504221917.4917a9eac7ab8cc90a0af5a1@kernel.org> X-Mailer: Sylpheed 3.7.0 (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-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Linus, Probes fixes for v6.9-rc6: - probe-events: Fix memory leak in parsing probe argument. There is a memory leak (forget to free an allocated buffer) in a memory allocation failure path. Fixes it to jump to the correct error handling code. Please pull the latest probes-fixes-v6.9-rc6 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-fixes-v6.9-rc6 Tag SHA1: 7ecfa9b34f812e244746158de5abfdd5132a4a62 Head SHA1: dce3696271af7765f04428ec31b1b87dc7d016c6 LuMingYin (1): tracing/probes: Fix memory leak in traceprobe_parse_probe_arg_body() ---- kernel/trace/trace_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --------------------------- commit dce3696271af7765f04428ec31b1b87dc7d016c6 Author: LuMingYin Date: Sat Apr 27 08:23:47 2024 +0100 tracing/probes: Fix memory leak in traceprobe_parse_probe_arg_body() If traceprobe_parse_probe_arg_body() failed to allocate 'parg->fmt', it jumps to the label 'out' instead of 'fail' by mistake.In the result, the buffer 'tmp' is not freed in this case and leaks its memory. Thus jump to the label 'fail' in that error case. Link: https://lore.kernel.org/all/20240427072347.1421053-1-lumingyindetect@126.com/ Fixes: 032330abd08b ("tracing/probes: Cleanup probe argument parser") Signed-off-by: LuMingYin Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index dfe3ee6035ec..42bc0f362226 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -1466,7 +1466,7 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size, parg->fmt = kmalloc(len, GFP_KERNEL); if (!parg->fmt) { ret = -ENOMEM; - goto out; + goto fail; } snprintf(parg->fmt, len, "%s[%d]", parg->type->fmttype, parg->count); -- Masami Hiramatsu (Google)