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 E73471AB530 for ; Wed, 26 Feb 2025 01:59:11 +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=1740535152; cv=none; b=HcDCCWwggD4vQQuOXLEEZOLE593Zw/aARN8LWam/xQWb1QSepypCCBxo2bDP/PvLDI6V8O6T1Z/QXy1EyTpZGuvy+uFGcBpTAHH4CmNmlnVbyozOvoTwm+PanzNMxiBiZXJhKswK9BeTRuDYIjA6VCgW65XyF4IXSqGuf1ifp8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535152; c=relaxed/simple; bh=vztBLHm2hhCG/O2TOH2O4w0cGcEA4SoBLJrU638YKUE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZCB9yRKRzrfkrQmn4m7EfDIVcpxvq1PO8fs7ov/GV2Nolv5WOvgSJXwgrUhcV52cLpiPfS5ChFh2A5rAJdqYMt4Vj/boPTy8CU2fYa/M8hBi4uJ9xa4n4rKG+PWjOQtDjrBLKdnlTRTgGIqTN3mDdqasm6OsB4xrS94J4AW/EKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HFpCB4kn; 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="HFpCB4kn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8C45C4CEDD; Wed, 26 Feb 2025 01:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535151; bh=vztBLHm2hhCG/O2TOH2O4w0cGcEA4SoBLJrU638YKUE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HFpCB4kntp55c+U4/lkLGqCzRAeZjeZSXqxSbcHGkJBNnp+z/2CfKA821rGLdJbkV lH/gPE9Ecn8LFo4ccxqqPVHZPH8TTJQZJdCIL7rjyPz1+iPcPzn4iyIEBacaxpxGvT Wiwytk7CqiH9rBF+1xxzV4QAsjalqUcen4PxcdHc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49181: xen: fix is_xen_pmu() Date: Wed, 26 Feb 2025 02:56:26 +0100 Message-ID: <2025022614-CVE-2022-49181-8181@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=4646; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vztBLHm2hhCG/O2TOH2O4w0cGcEA4SoBLJrU638YKUE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7StxcYxq3Zlfp5p51Lf9wn1viijnjiWdW51yuX+lcv 2if6t6lHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRtKcM80y+/Ttez5PfXnRU y95vtruJ/fF/sgzzKzYd35z/RMnH/6zENucUl569O2TKAQ== 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: xen: fix is_xen_pmu() is_xen_pmu() is taking the cpu number as parameter, but it is not using it. Instead it just tests whether the Xen PMU initialization on the current cpu did succeed. As this test is done by checking a percpu pointer, preemption needs to be disabled in order to avoid switching the cpu while doing the test. While resuming from suspend() this seems not to be the case: [ 88.082751] ACPI: PM: Low-level resume complete [ 88.087933] ACPI: EC: EC started [ 88.091464] ACPI: PM: Restoring platform NVS memory [ 88.097166] xen_acpi_processor: Uploading Xen processor PM info [ 88.103850] Enabling non-boot CPUs ... [ 88.108128] installing Xen timer for CPU 1 [ 88.112763] BUG: using smp_processor_id() in preemptible [00000000] code: systemd-sleep/7138 [ 88.122256] caller is is_xen_pmu+0x12/0x30 [ 88.126937] CPU: 0 PID: 7138 Comm: systemd-sleep Tainted: G W 5.16.13-2.fc32.qubes.x86_64 #1 [ 88.137939] Hardware name: Star Labs StarBook/StarBook, BIOS 7.97 03/21/2022 [ 88.145930] Call Trace: [ 88.148757] [ 88.151193] dump_stack_lvl+0x48/0x5e [ 88.155381] check_preemption_disabled+0xde/0xe0 [ 88.160641] is_xen_pmu+0x12/0x30 [ 88.164441] xen_smp_intr_init_pv+0x75/0x100 Fix that by replacing is_xen_pmu() by a simple boolean variable which reflects the Xen PMU initialization state on cpu 0. Modify xen_pmu_init() to return early in case it is being called for a cpu other than cpu 0 and the boolean variable not being set. The Linux kernel CVE team has assigned CVE-2022-49181 to this issue. Affected and fixed versions =========================== Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 4.14.276 with commit e9f72105cf4a16bb185093b60fc12dbc82fe15b5 Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 4.19.238 with commit d533c4a2e8c4ca3a0fe84d295a7bd43af1931028 Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.4.189 with commit ab2c789d1c0a3d0a682f7aa287754193471ff9f8 Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.10.110 with commit e9445a7a59d84ed3ae6c85f299d2a6c4930b1ee9 Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.15.33 with commit af884b276b08e2b7e74c2b9208df35f36fa6a54c Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.16.19 with commit 980bc42812c0a4788aee4b519bc911bfb911c23c Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.17.2 with commit 26911a822148bef5dcfc55e7df49cb05a18737e3 Issue introduced in 4.3 with commit bf6dfb154d935725c9a2005033ca33017b9df439 and fixed in 5.18 with commit de2ae403b4c0e79a3410e63bc448542fbb9f9bfc 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-49181 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/xen/pmu.c arch/x86/xen/pmu.h arch/x86/xen/smp_pv.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/e9f72105cf4a16bb185093b60fc12dbc82fe15b5 https://git.kernel.org/stable/c/d533c4a2e8c4ca3a0fe84d295a7bd43af1931028 https://git.kernel.org/stable/c/ab2c789d1c0a3d0a682f7aa287754193471ff9f8 https://git.kernel.org/stable/c/e9445a7a59d84ed3ae6c85f299d2a6c4930b1ee9 https://git.kernel.org/stable/c/af884b276b08e2b7e74c2b9208df35f36fa6a54c https://git.kernel.org/stable/c/980bc42812c0a4788aee4b519bc911bfb911c23c https://git.kernel.org/stable/c/26911a822148bef5dcfc55e7df49cb05a18737e3 https://git.kernel.org/stable/c/de2ae403b4c0e79a3410e63bc448542fbb9f9bfc