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 CB924157480 for ; Wed, 3 Apr 2024 17:32:37 +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=1712165557; cv=none; b=n/CjiH8JkDd0RWFi7mHZ3EVYkJ0DkYCKdSptcwPOyE9jIpRJtNn8x1UniFZRTFSGBJdXUBc+h8q6aepao69HmPsv0epAfTwzpTZ1WQ4vaDaIXfgnoUS/kPkWcIs+WgpzQbC/kBx6ijJTKoJfz0p5bkenXFdkqjSj5v0PVwDYDvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712165557; c=relaxed/simple; bh=3NdfSdwIeEPav5BTMddH3nfS+Gd5ZRB8fPLOeH0GARY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i907MWH0JKYv4dqDiUrSnEjQRh9FwjnOtI46ZLJCzQ3H1FXnPuAamR9U3KytMUKNFpkkIhrgzTdBLFVW9O914HNq4scoTTNQG5VetAqD1GsZaKxqFmqLdJ0RFol+wqWEv/K+jT4TdFkbxNNSs76xe5Kh3n4DB11sy2x1J94tq6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DjTMkTNz; 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="DjTMkTNz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7893C433F1; Wed, 3 Apr 2024 17:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712165557; bh=3NdfSdwIeEPav5BTMddH3nfS+Gd5ZRB8fPLOeH0GARY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=DjTMkTNzfL1FbzZewi7ZYBH8Iq7sjmQSTLjB7P8akf78DMH/zHK+9YhYZaBPn/inT 6MdJzluc3g0PFmWkjHu/xgZ3Mblf2EGAHSRO2odKQO59nEgDwujTet+MSPa/GiD9MG MGtFHJZfUIq6/qmO9AdXXsdwzUhGY8i+DH62LPmc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-26762: cxl/pci: Skip to handle RAS errors if CXL.mem device is detached Date: Wed, 3 Apr 2024 19:31:29 +0200 Message-ID: <2024040305-CVE-2024-26762-b719@gregkh> X-Mailer: git-send-email 2.44.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=3208; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3NdfSdwIeEPav5BTMddH3nfS+Gd5ZRB8fPLOeH0GARY=; b=owGbwMvMwCRo6H6F97bub03G02pJDGm8kyKvnrhW07bIZE34de0CcYYdc2bpvs74cmepvvjpQ 4kyV0yOdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEcgIZ5oe0LK+V1G3dsnnq 5i8167YdDpbacoBhvt/jMKkr8ccferKu7y7sd3jkJBDGCgA= 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: cxl/pci: Skip to handle RAS errors if CXL.mem device is detached The PCI AER model is an awkward fit for CXL error handling. While the expectation is that a PCI device can escalate to link reset to recover from an AER event, the same reset on CXL amounts to a surprise memory hotplug of massive amounts of memory. At present, the CXL error handler attempts some optimistic error handling to unbind the device from the cxl_mem driver after reaping some RAS register values. This results in a "hopeful" attempt to unplug the memory, but there is no guarantee that will succeed. A subsequent AER notification after the memdev unbind event can no longer assume the registers are mapped. Check for memdev bind before reaping status register values to avoid crashes of the form: BUG: unable to handle page fault for address: ffa00000195e9100 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page [...] RIP: 0010:__cxl_handle_ras+0x30/0x110 [cxl_core] [...] Call Trace: ? __die+0x24/0x70 ? page_fault_oops+0x82/0x160 ? kernelmode_fixup_or_oops+0x84/0x110 ? exc_page_fault+0x113/0x170 ? asm_exc_page_fault+0x26/0x30 ? __pfx_dpc_reset_link+0x10/0x10 ? __cxl_handle_ras+0x30/0x110 [cxl_core] ? find_cxl_port+0x59/0x80 [cxl_core] cxl_handle_rp_ras+0xbc/0xd0 [cxl_core] cxl_error_detected+0x6c/0xf0 [cxl_core] report_error_detected+0xc7/0x1c0 pci_walk_bus+0x73/0x90 pcie_do_recovery+0x23f/0x330 Longer term, the unbind and PCI_ERS_RESULT_DISCONNECT behavior might need to be replaced with a new PCI_ERS_RESULT_PANIC. The Linux kernel CVE team has assigned CVE-2024-26762 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 6ac07883dbb5 and fixed in 6.7.7 with commit 21e5e84f3f63 Issue introduced in 6.7 with commit 6ac07883dbb5 and fixed in 6.8 with commit eef5c7b28dbe 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-26762 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: drivers/cxl/core/pci.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/21e5e84f3f63fdf44e49642a6e45cd895e921a84 https://git.kernel.org/stable/c/eef5c7b28dbecd6b141987a96db6c54e49828102