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 8F437E567 for ; Thu, 1 May 2025 14:12:37 +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=1746108757; cv=none; b=BCziCHD6pNg5aXjPQhw6ZiUFjHkXkua2A93gc2nln5gxY24UNoMWAhsgnI4kS4JQlS3No7y14eATU3xWBjv30/KiXYCeAs1+9zyett9KUSXfs7ows99aaNNc8EO5hom7xkRuY4A9hqJVvLyE/gtRWFI/RyEBSMT4siMSHEIQA0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108757; c=relaxed/simple; bh=YVr0dzab/iaAtexmXBw9x5eyIHjaNs1tZM3Fm/YVHoA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TMYKyaYBJmnVVMGjdpnM5OqF86dJsBsBXICiNFxStnKsWym2QdpXQshbdg6zbZBqnnXPkezznWBjqxIBdWioNhAzQg0ZIzxHZtM6Gao8bx3+JLMxdIwhIhIK4/2IatrNIsYzyvIzByrpnUxmU32Aw8qPeWik+OxEiAAHHV8I6v0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AjFQMUZc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AjFQMUZc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EA77C4CEE3; Thu, 1 May 2025 14:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108757; bh=YVr0dzab/iaAtexmXBw9x5eyIHjaNs1tZM3Fm/YVHoA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=AjFQMUZcqpxzg56kVLKRsWA3M8u3mFtDGOoGJ/SqHJZ1EKVgD0FAoAOzyp5x7orNO o63qJPS4+lORx6NmWlOMIrpBXGIyBpXzzoFkof4hF7pV7PcteNbOiDl4wKphsZygTo wX1ndeoxWp9/GFU3VwroTPRyrLKh34jCBoYzyItQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49801: tracing: Fix memory leak in tracing_read_pipe() Date: Thu, 1 May 2025 16:09:51 +0200 Message-ID: <2025050126-CVE-2022-49801-2191@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3221; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ikZOosvZvhXhpxCyxQPPTrt1L/2czUR30Wp/YgI71QQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDdOWPd7qZ2925RpXBIPFSpXMzF/rNBKXLz/rkFnMM Lf9jNi1jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZgIDxfDPJN+w99zFxu8be30 lrHYL3lKOCs+iGHBnCt8DJrOGgbPt0Vcu+WVpaydKc0KAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: tracing: Fix memory leak in tracing_read_pipe() kmemleak reports this issue: unreferenced object 0xffff888105a18900 (size 128): comm "test_progs", pid 18933, jiffies 4336275356 (age 22801.766s) hex dump (first 32 bytes): 25 73 00 90 81 88 ff ff 26 05 00 00 42 01 58 04 %s......&...B.X. 03 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000560143a1>] __kmalloc_node_track_caller+0x4a/0x140 [<000000006af00822>] krealloc+0x8d/0xf0 [<00000000c309be6a>] trace_iter_expand_format+0x99/0x150 [<000000005a53bdb6>] trace_check_vprintf+0x1e0/0x11d0 [<0000000065629d9d>] trace_event_printf+0xb6/0xf0 [<000000009a690dc7>] trace_raw_output_bpf_trace_printk+0x89/0xc0 [<00000000d22db172>] print_trace_line+0x73c/0x1480 [<00000000cdba76ba>] tracing_read_pipe+0x45c/0x9f0 [<0000000015b58459>] vfs_read+0x17b/0x7c0 [<000000004aeee8ed>] ksys_read+0xed/0x1c0 [<0000000063d3d898>] do_syscall_64+0x3b/0x90 [<00000000a06dda7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd iter->fmt alloced in tracing_read_pipe() -> .. ->trace_iter_expand_format(), but not freed, to fix, add free in tracing_release_pipe() The Linux kernel CVE team has assigned CVE-2022-49801 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit efbbdaa22bb78761bff8dfdde027ad04bedd47ce and fixed in 5.15.80 with commit 2c21ee020ce43d744ecd7f3e9bddfcaafef270ce Issue introduced in 5.12 with commit efbbdaa22bb78761bff8dfdde027ad04bedd47ce and fixed in 6.0.10 with commit a7d3f8f33c113478737bc61bb32ec5f9a987da7d Issue introduced in 5.12 with commit efbbdaa22bb78761bff8dfdde027ad04bedd47ce and fixed in 6.1 with commit 649e72070cbbb8600eb823833e4748f5a0815116 Issue introduced in 5.10.190 with commit 840ce9cfc86f89c335625ec297acc0375f82e19b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49801 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: kernel/trace/trace.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/2c21ee020ce43d744ecd7f3e9bddfcaafef270ce https://git.kernel.org/stable/c/a7d3f8f33c113478737bc61bb32ec5f9a987da7d https://git.kernel.org/stable/c/649e72070cbbb8600eb823833e4748f5a0815116