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 372294E1A8 for ; Tue, 26 Mar 2024 17:50:25 +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=1711475426; cv=none; b=Fm8xl4BBCQFFyoYwPRhMtamTx8KhyQscF63G13JhGUrxXdQn9Ow+V67kwmkg9AFOyyOOh9o4P9ttR6TgH2XhyZ0k1fMj9PCII/kJegURdeZeOUhGfuKhft28kxpr/bilovzmC5gBnScT5e5HHkmSmShaM29HvH+A1Mgbr5EQxCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711475426; c=relaxed/simple; bh=ZoKbYWm5bX1ZCe2YMdYmfU3qGnYQ0X+RBmAIp/PO4vQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gPOjncvPzhvZGKSjaX3aeNk34l9+NfYMe7/3bY8tzMdNLmTMhqdJ/Ga8BSRguM0UwM3YDK/3tXE1JC7DDTTCCKm8sSwcLXKWU42VQ1/1eIoMY1Dtnq8UvQTzOHPTvmQK1Rn+Jtx+AeS9zhoZfvcYYGMpD2INMoJ5g8lAr/H0d7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nmstmNiL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nmstmNiL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F085C433F1; Tue, 26 Mar 2024 17:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711475425; bh=ZoKbYWm5bX1ZCe2YMdYmfU3qGnYQ0X+RBmAIp/PO4vQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nmstmNiLtpPk7agPYDNwqt7sI/YaHo/8oeo1HXU+Vd7WSSozn/0wl4x2wIt9/0NMF ULwnu61Ny5/fYJ6Zdq4ONLNRqIYFET2svg/m2TPwJCSndwqZnV7PvFgoIJ8irk7XAH MO17DXCtTOUM/+LAAivV8Y2UcojIAlTQwh1bLLsi0lRn9ktod3xVrFNSZ50DABIich MVLmrt0dt84hnkOMAGApz5cQ5wF4mvMjtqKWbAYqnpuaaqAif+freK7BMOgCPG2Msg Br5fXbyzFFnNs44F+UtOZdGpndtom43Pg34Lb+Oszl/pt4aiSzcxpAhcBOQRrQGAeZ rW+Hj5hnSmu9g== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-26650: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe Date: Tue, 26 Mar 2024 17:50:16 +0000 Message-ID: <20240326175007.1388794-18-lee@kernel.org> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog 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=2990; i=lee@kernel.org; h=from:subject; bh=ZoKbYWm5bX1ZCe2YMdYmfU3qGnYQ0X+RBmAIp/PO4vQ=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBmAwrQXhGLtfsPNoqKXW99am2TOhxkiDjBR59Ng heUdClm+IqJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZgMK0AAKCRBRr4ovh/x3 YfghD/420hCu3C56YtEXvV6RDovMPW2V4nO2xdMBu/WrNZa95g6SVkFfGrQvQ6HpDqa7zn7aqod eqzR4mPf7EAFq/Zh2+AAzLrt157BZVwEbnUkkUq4WFrZuOA6joXn9/uaMPC4Sq7ZjxI4YM49Y0l Flj39Pwh2BAl//mc/+aWNXE781tcnFa35JBaNfalK556EY4SyPIx25AErxd3/7sQuXST6Ihfenz WpUM88LtNtQBrr7XsiCdgaNe4CQnoQwzctcMB9hDyj1thiQVc8w20h+IEU4EvXlDTDIdfhacSpl xV9fp4zYxAn5ltXL7HITedFN4blmuFE1KHSVdJm2gYXmxBvKoKoKH26+W1Dwz6AZcV1q7/4jT91 EjKexVSHa4IL9FbtUSfYPUola7FTHEs80o+tKRxsxs71/ftvtt7ZnhLvnwOI/z7Uv0PgheMAmUW CTjLdaKoKpDKvY0UwLCpeHOXhegcToFSU/XDgvucQRU1yqXNAH92lHvlSIfhFIWcr6aP58tGHRI C7zXjAHRp+KCObQKp4gw2xKOQEJTLWdIiswbvrD1LVGsyPhWSl9USuNT1lofmKwcwRZ/Wya0Aa8 4s57o0xvruCE6VUvuhAZX1nV5XqM7KTqxvZc1+5WB/NXEbufYGfoSJZEox31a9U+s2GOqozIMfH g5HAcY7ackorV6g== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe p2sb_bar() unhides P2SB device to get resources from the device. It guards the operation by locking pci_rescan_remove_lock so that parallel rescans do not find the P2SB device. However, this lock causes deadlock when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan locks pci_rescan_remove_lock and probes PCI devices. When PCI devices call p2sb_bar() during probe, it locks pci_rescan_remove_lock again. Hence the deadlock. To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar(). Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources() for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(), refer the cache and return to the caller. Before operating the device at P2SB DEVFN for resource cache, check that its device class is PCI_CLASS_MEMORY_OTHER 0x0580 that PCH specifications define. This avoids unexpected operation to other devices at the same DEVFN. Tested-by Klara Modin The Linux kernel CVE team has assigned CVE-2024-26650 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.1.76 with commit 2841631a0365 Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.6.15 with commit 847e1eb30e26 Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.7.3 with commit d281ac9a987c Issue introduced in 6.0 with commit 9745fb07474f and fixed in 6.8 with commit 5913320eb0b3 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-26650 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/platform/x86/p2sb.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/2841631a03652f32b595c563695d0461072e0de4 https://git.kernel.org/stable/c/847e1eb30e269a094da046c08273abe3f3361cf2 https://git.kernel.org/stable/c/d281ac9a987c553d93211b90fd4fe97d8eca32cd https://git.kernel.org/stable/c/5913320eb0b3ec88158cfcb0fa5e996bf4ef681b