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 5601B256D for ; Wed, 26 Feb 2025 02:23:59 +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=1740536639; cv=none; b=a20iu9dHJO1xrdBOkpjhQDARYZtxNwS0tBs6C50bgDB6GzyLlfNN+uhD2HMhEAnBfUafvq1jHJvQgmKSg3C0QUQfDjk960WUC9okbRVYva20iHRuB8w2QzugT33JfcZ+lSA1dLlfnKTedytIoOECRwBhHDPXe1WNDBro3lwzX8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536639; c=relaxed/simple; bh=M9+TgE2Z2UNaLXS3i/pNNlh/7FK1JmFbmGbG9fKMzJE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nm9ynTngLuMZwdlEEBu8/7+NDB7sPJS+v9c3QK/KM4LY3Z/RJOysh/3g5H3/NSzOTv0cpQIZ/ubMVRd5Bf4RZxunVghX+BWSTZ/h09n4Q2kU2ZvVpD2506qjWIW61ypDS2uw/f8RTdP7yHTWZo4mbG3OAc+uCfXKGSbhzpl1o9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wW95RZ2T; 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="wW95RZ2T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20B1EC4CEDD; Wed, 26 Feb 2025 02:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536639; bh=M9+TgE2Z2UNaLXS3i/pNNlh/7FK1JmFbmGbG9fKMzJE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=wW95RZ2TRoN7ZTUkoeGW+ImqTsG5VBWJuxASRP1MNXmui6TJut7D4KC7YscLb8ucg ws/KnGJxNYohab7HLfUqNHWGXYpIFXfdHYHifO/KT4cN14aR05+sZAKOwDC/P/AJMf Je/R48Th1P7ir9goi5+eWFyAjT7uxqh3AFDkQs+4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49565: perf/x86/intel/lbr: Fix unchecked MSR access error on HSW Date: Wed, 26 Feb 2025 03:22:08 +0100 Message-ID: <2025022605-CVE-2022-49565-e60d@gregkh> X-Mailer: git-send-email 2.48.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=2953; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=M9+TgE2Z2UNaLXS3i/pNNlh/7FK1JmFbmGbG9fKMzJE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7qs4ef51srMSSyRBwwu/Hld+fMxUqFeS314TZZz4/M PG1X2pgRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzktgDD/KiF1hdeu8/uWXw+ 10Pqh1jGJMMWaYYFTQxfYozPz7YNLLbq2mvRFVHqIJYIAA== 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: perf/x86/intel/lbr: Fix unchecked MSR access error on HSW The fuzzer triggers the below trace. [ 7763.384369] unchecked MSR access error: WRMSR to 0x689 (tried to write 0x1fffffff8101349e) at rIP: 0xffffffff810704a4 (native_write_msr+0x4/0x20) [ 7763.397420] Call Trace: [ 7763.399881] [ 7763.401994] intel_pmu_lbr_restore+0x9a/0x1f0 [ 7763.406363] intel_pmu_lbr_sched_task+0x91/0x1c0 [ 7763.410992] __perf_event_task_sched_in+0x1cd/0x240 On a machine with the LBR format LBR_FORMAT_EIP_FLAGS2, when the TSX is disabled, a TSX quirk is required to access LBR from registers. The lbr_from_signext_quirk_needed() is introduced to determine whether the TSX quirk should be applied. However, the lbr_from_signext_quirk_needed() is invoked before the intel_pmu_lbr_init(), which parses the LBR format information. Without the correct LBR format information, the TSX quirk never be applied. Move the lbr_from_signext_quirk_needed() into the intel_pmu_lbr_init(). Checking x86_pmu.lbr_has_tsx in the lbr_from_signext_quirk_needed() is not required anymore. Both LBR_FORMAT_EIP_FLAGS2 and LBR_FORMAT_INFO have LBR_TSX flag, but only the LBR_FORMAT_EIP_FLAGS2 requirs the quirk. Update the comments accordingly. The Linux kernel CVE team has assigned CVE-2022-49565 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 1ac7fd8159a842b3aa51f0b46a351fa3eeb8fbf3 and fixed in 5.18.15 with commit 625bcd0685a1612225df83468c83412fc0edb3d7 Issue introduced in 5.17 with commit 1ac7fd8159a842b3aa51f0b46a351fa3eeb8fbf3 and fixed in 5.19 with commit b0380e13502adf7dd8be4c47d622c3522aae6c63 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-49565 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/intel/lbr.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/625bcd0685a1612225df83468c83412fc0edb3d7 https://git.kernel.org/stable/c/b0380e13502adf7dd8be4c47d622c3522aae6c63