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 AC7D815530F for ; Mon, 6 Jan 2025 16:21: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=1736180490; cv=none; b=TsqcFfWI7iH+uRJYfpr4HVw8xh5RyT5rKKEt8X7YXQg8nrTL316TXtc7J2TJhu33ujFvlPs2DXYiXSAGbBOJWv8UOoC9wtRMRnru5T5gB5buf1CNblncx2e/KqXDQg1z5Xm9Rrp1YFGvfW0gLVkaM8BKwxffpb09f+6q8fd8KPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736180490; c=relaxed/simple; bh=2UPkncG+S8vESjFBw2qDU9C05M3fRxjERhjZHHK6cLs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FczAkpcRj1y5lhITJNgAYNTkl447rYX8uOxHk6gI+tmx6YH4FA4HhuCqrF+vdrFOPNWBs2RseigejI0E1qnDoTL7a7JH7l4qI4vjHZe+l0Xdk+yqdwscp+CJiBo9NOKKQK774NGUrW8dEctyzjLjuXarypr6VH0JInDMSjMTx8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j35qXRCl; 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="j35qXRCl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9F0AC4CED2; Mon, 6 Jan 2025 16:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736180490; bh=2UPkncG+S8vESjFBw2qDU9C05M3fRxjERhjZHHK6cLs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=j35qXRCl/RYu8rwNTnOpzsAR2T8h5u1ly9DWtwWuOKBMIKv4XjMHR5w2dv8z2Gr/j VRcFwf1Qe/f+DTeRpa2YhrYcAjaGkjD9l6FuebfwIadwloyfnMQwhyCk9Nl91XMopY 3sP7KsK+yB4EOCLNAx2KbOhapuSmfc+Qi2rzok+Y= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56761: x86/fred: Clear WFE in missing-ENDBRANCH #CPs Date: Mon, 6 Jan 2025 17:20:55 +0100 Message-ID: <2025010654-CVE-2024-56761-0be0@gregkh> X-Mailer: git-send-email 2.47.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=2864; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2UPkncG+S8vESjFBw2qDU9C05M3fRxjERhjZHHK6cLs=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk1TM+qmI0nT+V7vWz6JdW2LQ+dQ276qTxrO+Slremw1 jPmeFZRRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkxgmGBadV2vR59Bh+pGk2 Fjw8zJfql5ZqyzBXipuz7arM6nCvKM9/ZluiZFaLOe4BAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: x86/fred: Clear WFE in missing-ENDBRANCH #CPs An indirect branch instruction sets the CPU indirect branch tracker (IBT) into WAIT_FOR_ENDBRANCH (WFE) state and WFE stays asserted across the instruction boundary. When the decoder finds an inappropriate instruction while WFE is set ENDBR, the CPU raises a #CP fault. For the "kernel IBT no ENDBR" selftest where #CPs are deliberately triggered, the WFE state of the interrupted context needs to be cleared to let execution continue. Otherwise when the CPU resumes from the instruction that just caused the previous #CP, another missing-ENDBRANCH #CP is raised and the CPU enters a dead loop. This is not a problem with IDT because it doesn't preserve WFE and IRET doesn't set WFE. But FRED provides space on the entry stack (in an expanded CS area) to save and restore the WFE state, thus the WFE state is no longer clobbered, so software must clear it. Clear WFE to avoid dead looping in ibt_clear_fred_wfe() and the !ibt_fatal code path when execution is allowed to continue. Clobbering WFE in any other circumstance is a security-relevant bug. [ dhansen: changelog rewording ] The Linux kernel CVE team has assigned CVE-2024-56761 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit a5f6c2ace9974adf92ce65dacca8126d90adabfe and fixed in 6.12.8 with commit b939f108e86b76119428a6fa4e92491e09ac7867 Issue introduced in 6.6 with commit a5f6c2ace9974adf92ce65dacca8126d90adabfe and fixed in 6.13-rc5 with commit dc81e556f2a017d681251ace21bf06c126d5a192 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-56761 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/cet.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/b939f108e86b76119428a6fa4e92491e09ac7867 https://git.kernel.org/stable/c/dc81e556f2a017d681251ace21bf06c126d5a192