From mboxrd@z Thu Jan 1 00:00:00 1970 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 7A8E2168DC for ; Sun, 19 May 2024 08:35: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=1716107734; cv=none; b=PUthG00/o0sXGNYAYskrmIDUGmXbmCB997L1o3ToMG3d5QrNjrpx8fEskCvHFSvRm6oAosojOMKaGRw/kFPBZCCqjzcLjd2ByjmStqounO0CmczFb/hyEjzZHsHR3EkRK01D47cYl9XH1MxXH2p/C1qx8Mc9ENsLRkOMio3w7TY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716107734; c=relaxed/simple; bh=BpEH8gvP6zgREgvCzWona96OiPrmLZPa/k878uyqbE4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=p4YXqZf5RXP3O6IOY/YEDhb4SWP4RmknQbzZXF3i6w0mfinvafiZ3BobLZwcaotn5udPpIu9lR8ySAJIVl87X72kljVgGVvwQyvZ5AFtMXmH9bSSeFBRA2cQmNhadsEWaHnlkqsnxq2i2Eudg2TD0mze3lvg5xRVqc2WXukLE9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=180eZvIc; 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="180eZvIc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3BFCC32781; Sun, 19 May 2024 08:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716107734; bh=BpEH8gvP6zgREgvCzWona96OiPrmLZPa/k878uyqbE4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=180eZvIcM3KVpPsBvXrwzxamzyyiy68Bag7wthcEvM7zs+3RSjFd4vOsMcHkeIMoM NqQgWgGHlktjtnAR3QpTU7kKDer+NEfSRXZ0ktyFMo5R3l9758x8bEZyjOgOrWUO3q J3jDXTAaO3bMOcDPrHBKXuBGqMsJ6/AHmU67y0UI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35876: x86/mce: Make sure to grab mce_sysfs_mutex in set_bank() Date: Sun, 19 May 2024 10:34:50 +0200 Message-ID: <2024051943-CVE-2024-35876-d9b5@gregkh> X-Mailer: git-send-email 2.45.1 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=3160; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=BpEH8gvP6zgREgvCzWona96OiPrmLZPa/k878uyqbE4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmeOxebTFkjmGylUXmtXyxxWpHtYn/jvvuhVxduaL3/7 OKD1S2TOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiCdUMc6U3Ba1cw111fEkJ +ySNtD8BDVkKPgzzdGreFuhwP5Hnt5eJC2ResX/VTddEAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: x86/mce: Make sure to grab mce_sysfs_mutex in set_bank() Modifying a MCA bank's MCA_CTL bits which control which error types to be reported is done over /sys/devices/system/machinecheck/ ├── machinecheck0 │   ├── bank0 │   ├── bank1 │   ├── bank10 │   ├── bank11 ... sysfs nodes by writing the new bit mask of events to enable. When the write is accepted, the kernel deletes all current timers and reinits all banks. Doing that in parallel can lead to initializing a timer which is already armed and in the timer wheel, i.e., in use already: ODEBUG: init active (active state 0) object: ffff888063a28000 object type: timer_list hint: mce_timer_fn+0x0/0x240 arch/x86/kernel/cpu/mce/core.c:2642 WARNING: CPU: 0 PID: 8120 at lib/debugobjects.c:514 debug_print_object+0x1a0/0x2a0 lib/debugobjects.c:514 Fix that by grabbing the sysfs mutex as the rest of the MCA sysfs code does. Reported by: Yue Sun Reported by: xingwei lee The Linux kernel CVE team has assigned CVE-2024-35876 to this issue. Affected and fixed versions =========================== Fixed in 5.4.274 with commit 976b1b2680fb Fixed in 5.10.215 with commit f5e65b782f3e Fixed in 5.15.154 with commit f860595512ff Fixed in 6.1.85 with commit 20a915154ccb Fixed in 6.6.26 with commit 5a02df3e9247 Fixed in 6.8.5 with commit 32223b0b60d5 Fixed in 6.9 with commit 3ddf944b32f8 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-2024-35876 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/kernel/cpu/mce/core.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/976b1b2680fb4c01aaf05a0623288d87619a6c93 https://git.kernel.org/stable/c/f5e65b782f3e07324b9a8fa3cdaee422f057c758 https://git.kernel.org/stable/c/f860595512ff5c05a29fa4d64169c3fd1186b8cf https://git.kernel.org/stable/c/20a915154ccb88da08986ab6c9fc4c1cf6259de2 https://git.kernel.org/stable/c/5a02df3e92470efd589712925b5c722e730276a0 https://git.kernel.org/stable/c/32223b0b60d53f49567fc501f91ca076ae96be6b https://git.kernel.org/stable/c/3ddf944b32f88741c303f0b21459dbb3872b8bc5