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 5FEAC2D7BF for ; Thu, 1 May 2025 14:11:34 +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=1746108695; cv=none; b=pDF44I1C6t9OCPWQiq9UQy7uXaiU/lh+Rd/v7zewWdDCG27gL3mtgAyBipmFjpXuL17FSEpFf+IIQbUSAB8klHqbn7LyEfrZoBQ9njznTjX37W8ePF3n4HOV3OnbNWiQ+/mn8PYGfv1DrAUks7gm5FAcPgyQ/KcJZKIUmF6JcRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108695; c=relaxed/simple; bh=qnbKdDg0cb9QcUeb+m0RyebnIJ+XdpffcuWkHpE/gag=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RrrqEE8P7erURZTX+k4XnTzd/HtP5ry66skXAczLhlfdBDGYWseIj03tC/t9lvWJ1Yus0rBLBKCwZd+0+rZhdoP9kP6xmMlXWVlAqRQY4JY0oQIjhEhSB71HvjCVJ/Q9/OUT1l74WSXGlNvL/SyJDvXkcfI7+33WRfeb/Hd9BK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=u3aM1mk5; 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="u3aM1mk5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8184CC4CEE3; Thu, 1 May 2025 14:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108694; bh=qnbKdDg0cb9QcUeb+m0RyebnIJ+XdpffcuWkHpE/gag=; h=From:To:Cc:Subject:Date:Reply-to:From; b=u3aM1mk5ycsCn3YVQ8cwK5Y2dniQRF5iSnHw7nLfGy05TWqzAhT0TCivF01Ucr6h7 LVTV7R1QTu4ovFuE681SV/tAOlq6YraeRGWvdI/QUJg9jy6RGnhCgdD9/XDuQ0qs2D 8VrzRP0XrVNRRI/ttCRCYh75rnBgzLlqRvWXIpmM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49784: perf/x86/amd/uncore: Fix memory leak for events array Date: Thu, 1 May 2025 16:09:34 +0200 Message-ID: <2025050120-CVE-2022-49784-12c5@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=3862; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=KUtlhvfr2Xgtip7YKn0hGmxQrApYK45bttLeqWEJAz0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDRPuLdp/8dSS1aybV67XkV7KybjcMns6k4lq3buEJ 6npEt+kO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiv2UZ5mm877T0frR3760/ z6Wnfo830D/R/49hnnLgzvNLfwbvf/RAKDJL8sLHPqvtbQA= 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: perf/x86/amd/uncore: Fix memory leak for events array When a CPU comes online, the per-CPU NB and LLC uncore contexts are freed but not the events array within the context structure. This causes a memory leak as identified by the kmemleak detector. [...] unreferenced object 0xffff8c5944b8e320 (size 32): comm "swapper/0", pid 1, jiffies 4294670387 (age 151.072s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000000759fb79>] amd_uncore_cpu_up_prepare+0xaf/0x230 [<00000000ddc9e126>] cpuhp_invoke_callback+0x2cf/0x470 [<0000000093e727d4>] cpuhp_issue_call+0x14d/0x170 [<0000000045464d54>] __cpuhp_setup_state_cpuslocked+0x11e/0x330 [<0000000069f67cbd>] __cpuhp_setup_state+0x6b/0x110 [<0000000015365e0f>] amd_uncore_init+0x260/0x321 [<00000000089152d2>] do_one_initcall+0x3f/0x1f0 [<000000002d0bd18d>] kernel_init_freeable+0x1ca/0x212 [<0000000030be8dde>] kernel_init+0x11/0x120 [<0000000059709e59>] ret_from_fork+0x22/0x30 unreferenced object 0xffff8c5944b8dd40 (size 64): comm "swapper/0", pid 1, jiffies 4294670387 (age 151.072s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000306efe8b>] amd_uncore_cpu_up_prepare+0x183/0x230 [<00000000ddc9e126>] cpuhp_invoke_callback+0x2cf/0x470 [<0000000093e727d4>] cpuhp_issue_call+0x14d/0x170 [<0000000045464d54>] __cpuhp_setup_state_cpuslocked+0x11e/0x330 [<0000000069f67cbd>] __cpuhp_setup_state+0x6b/0x110 [<0000000015365e0f>] amd_uncore_init+0x260/0x321 [<00000000089152d2>] do_one_initcall+0x3f/0x1f0 [<000000002d0bd18d>] kernel_init_freeable+0x1ca/0x212 [<0000000030be8dde>] kernel_init+0x11/0x120 [<0000000059709e59>] ret_from_fork+0x22/0x30 [...] Fix the problem by freeing the events array before freeing the uncore context. The Linux kernel CVE team has assigned CVE-2022-49784 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 39621c5808f5dda75d03dc4b2d4d2b13a5a1c34b and fixed in 6.0.10 with commit f75be9885d49e3717de962345c4572ddab52b178 Issue introduced in 6.0 with commit 39621c5808f5dda75d03dc4b2d4d2b13a5a1c34b and fixed in 6.1 with commit bdfe34597139cfcecd47a2eb97fea44d77157491 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-49784 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: arch/x86/events/amd/uncore.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/f75be9885d49e3717de962345c4572ddab52b178 https://git.kernel.org/stable/c/bdfe34597139cfcecd47a2eb97fea44d77157491