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 31D5F1DFE22 for ; Thu, 1 May 2025 14:12:30 +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=1746108752; cv=none; b=o32nQtpNEjMd/XlO18m6NgSRckWuTR5zYvNZNRvtdq6DVXiJUpUSJqJG8wmx3pnt/R8yonYM0l+BZlUzFIF/w+cyHUdCKoGP0WEWMyaPzz7y1Fhq/Uf0TixOpno18cCUfCv+nynYaQCZwnTRYQeb428lU84ICRw95rLyW6XEfpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108752; c=relaxed/simple; bh=VkuM9wq6+nQNbYUfzAH9X+2apAWz4DbmPBIDxVmWwpo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MS9A9aawdE9W87+v4tHyPjexGdD9Fmz2bhZr3cLQFlJ8xHgP6eBQa2nKenCHeFj0yU6lzXyj7IX2qyIjJeCBU74bq/yYz/9UugQkREF9aTCK/JwFQijTyZYxiuJv/UxXjP4kHi/FZu1gPliObo2xmIlBLVLdOpqSii0fG2gDRuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qUFZ/AQR; 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="qUFZ/AQR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FAFDC4CEE3; Thu, 1 May 2025 14:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108750; bh=VkuM9wq6+nQNbYUfzAH9X+2apAWz4DbmPBIDxVmWwpo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=qUFZ/AQRPwWtasGtmbJB/ZUULExIElU9OtRQQKPFuwfJOK+QuVCLYgS9Fr4Y89Yer tMT1JXQI3LI2TaTNhT6kf7ryZ6Ht0TEWZ6uWhlM21mSJVAyrw1p+FIELl9qoalg3CL HemzUgjF+sn/GxVYV28Ju7Ko5nWXEw6Yyb5hHvto= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49800: tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event() Date: Thu, 1 May 2025 16:09:50 +0200 Message-ID: <2025050126-CVE-2022-49800-11d1@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=3998; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vxmCDVdVFuuB8hO36EiCqSPHIfsl35IQ8nXN+DbP6X0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDdOKstbkz8wxWrxd6ObvOQlSE9128u1kvLXWhzX13 sqIVVu4OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiZ3YyLJj2+rpeC8tdIbeF G07zLwwTefNnghXD/NR1CVm8krsXO10JFI7f1B7p7WVWDwA= 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 test_gen_synth_cmd() and test_empty_synth_event() test_gen_synth_cmd() only free buf in fail path, hence buf will leak when there is no failure. Add kfree(buf) to prevent the memleak. The same reason and solution in test_empty_synth_event(). unreferenced object 0xffff8881127de000 (size 2048): comm "modprobe", pid 247, jiffies 4294972316 (age 78.756s) hex dump (first 32 bytes): 20 67 65 6e 5f 73 79 6e 74 68 5f 74 65 73 74 20 gen_synth_test 20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 64 5f pid_t next_pid_ backtrace: [<000000004254801a>] kmalloc_trace+0x26/0x100 [<0000000039eb1cf5>] 0xffffffffa00083cd [<000000000e8c3bc8>] 0xffffffffa00086ba [<00000000c293d1ea>] do_one_initcall+0xdb/0x480 [<00000000aa189e6d>] do_init_module+0x1cf/0x680 [<00000000d513222b>] load_module+0x6a50/0x70a0 [<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0 [<00000000b36c4c0f>] do_syscall_64+0x3f/0x90 [<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd unreferenced object 0xffff8881127df000 (size 2048): comm "modprobe", pid 247, jiffies 4294972324 (age 78.728s) hex dump (first 32 bytes): 20 65 6d 70 74 79 5f 73 79 6e 74 68 5f 74 65 73 empty_synth_tes 74 20 20 70 69 64 5f 74 20 6e 65 78 74 5f 70 69 t pid_t next_pi backtrace: [<000000004254801a>] kmalloc_trace+0x26/0x100 [<00000000d4db9a3d>] 0xffffffffa0008071 [<00000000c31354a5>] 0xffffffffa00086ce [<00000000c293d1ea>] do_one_initcall+0xdb/0x480 [<00000000aa189e6d>] do_init_module+0x1cf/0x680 [<00000000d513222b>] load_module+0x6a50/0x70a0 [<000000001fd4d529>] __do_sys_finit_module+0x12f/0x1c0 [<00000000b36c4c0f>] do_syscall_64+0x3f/0x90 [<00000000bbf20cf3>] entry_SYSCALL_64_after_hwframe+0x63/0xcd The Linux kernel CVE team has assigned CVE-2022-49800 to this issue. Affected and fixed versions =========================== Issue introduced in 5.6 with commit 9fe41efaca08416657efa8731c0d47ccb6a3f3eb and fixed in 5.10.156 with commit 65ba7e7c241122ef0a9e61d1920f2ae9689aa796 Issue introduced in 5.6 with commit 9fe41efaca08416657efa8731c0d47ccb6a3f3eb and fixed in 5.15.80 with commit 07ba4f0603aba288580866394f2916dfe55823a2 Issue introduced in 5.6 with commit 9fe41efaca08416657efa8731c0d47ccb6a3f3eb and fixed in 6.0.10 with commit 0e5baaa181a052d968701bb9c5b1d55847f00942 Issue introduced in 5.6 with commit 9fe41efaca08416657efa8731c0d47ccb6a3f3eb and fixed in 6.1 with commit a4527fef9afe5c903c718d0cd24609fe9c754250 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-49800 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/synth_event_gen_test.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/65ba7e7c241122ef0a9e61d1920f2ae9689aa796 https://git.kernel.org/stable/c/07ba4f0603aba288580866394f2916dfe55823a2 https://git.kernel.org/stable/c/0e5baaa181a052d968701bb9c5b1d55847f00942 https://git.kernel.org/stable/c/a4527fef9afe5c903c718d0cd24609fe9c754250