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 416911FBEA4 for ; Wed, 16 Apr 2025 14:13:48 +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=1744812829; cv=none; b=aLDsXjT/RTgq7kUMT3UQ+okHYzb1Fd0sJRXJGNs+k/kWfQ1El+a3NjAODnx667/VFIo6huEh3Smvmq80SWwJbQnWeM3MLJr7a8E3A5UcMM6RVA7xQz0uXmo2vt4UDyl/LystGJ/6iaX0B6lXTk7SO5jN/s9kKOAxFH8jbbtMeow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744812829; c=relaxed/simple; bh=2LrlEV5t0/jBtSAKcqa964kVz8pcWZ2O7/4uGcSKIEE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aQI5jeN9siDSJDrPE7ZKYi7Lk6XJfj0rNBvKjSgynABEGnJ0tUqgW9vHI3FelVuPOVS8Zz/Zx3h4LmEtXCECK2teeF/pJen3wvZIR2UNTwlV6HJSuzetO78akDuRI5T+5/nATPdeyJqALBXpCCyLJ4kHI557+wjP0fcG2jVdfrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1QTLFAgv; 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="1QTLFAgv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10BAEC4CEE2; Wed, 16 Apr 2025 14:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744812828; bh=2LrlEV5t0/jBtSAKcqa964kVz8pcWZ2O7/4uGcSKIEE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1QTLFAgvM4tydxhahUBAio66gsLzPcgO0C/APTk+HaskfmzR+Ro/rpu75Na7r0rSk McLQdcOl/J+nqLYHuFrXiwYFx4CYEeL1TFcLUDNXQz1uzfCeQn3Me9eLry53LQHbgH DZJ/MsITATthX5pjmfrOvM2wwLO1a/bbbL1sfN38= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22031: PCI/bwctrl: Fix NULL pointer dereference on bus number exhaustion Date: Wed, 16 Apr 2025 16:12:02 +0200 Message-ID: <2025041656-CVE-2025-22031-b941@gregkh> X-Mailer: git-send-email 2.49.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=3642; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2LrlEV5t0/jBtSAKcqa964kVz8pcWZ2O7/4uGcSKIEE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d63RWHyp/dJ8PbtCzuIpsZMaGD91rNFiNajcJjZ7v ui3rzMndcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBElsYzzM8sMxFmEiytrFwz PSDn8crcXSc6OBjmGbpsTpXYFi3bumW7e9z0iRa+c+JKAA== 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: PCI/bwctrl: Fix NULL pointer dereference on bus number exhaustion When BIOS neglects to assign bus numbers to PCI bridges, the kernel attempts to correct that during PCI device enumeration. If it runs out of bus numbers, no pci_bus is allocated and the "subordinate" pointer in the bridge's pci_dev remains NULL. The PCIe bandwidth controller erroneously does not check for a NULL subordinate pointer and dereferences it on probe. Bandwidth control of unusable devices below the bridge is of questionable utility, so simply error out instead. This mirrors what PCIe hotplug does since commit 62e4492c3063 ("PCI: Prevent NULL dereference during pciehp probe"). The PCI core emits a message with KERN_INFO severity if it has run out of bus numbers. PCIe hotplug emits an additional message with KERN_ERR severity to inform the user that hotplug functionality is disabled at the bridge. A similar message for bandwidth control does not seem merited, given that its only purpose so far is to expose an up-to-date link speed in sysfs and throttle the link speed on certain laptops with limited Thermal Design Power. So error out silently. User-visible messages: pci 0000:16:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring [...] pci_bus 0000:45: busn_res: [bus 45-74] end is updated to 74 pci 0000:16:02.0: devices behind bridge are unusable because [bus 45-74] cannot be assigned for them [...] pcieport 0000:16:02.0: pciehp: Hotplug bridge without secondary bus, ignoring [...] BUG: kernel NULL pointer dereference RIP: pcie_update_link_speed pcie_bwnotif_enable pcie_bwnotif_probe pcie_port_probe_service really_probe The Linux kernel CVE team has assigned CVE-2025-22031 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit 665745f274870c921020f610e2c99a3b1613519b and fixed in 6.13.11 with commit d93d309013e89631630a12b1770d27e4be78362a Issue introduced in 6.13 with commit 665745f274870c921020f610e2c99a3b1613519b and fixed in 6.14.2 with commit 1181924af78e5299ddec6e457789c02dd5966559 Issue introduced in 6.13 with commit 665745f274870c921020f610e2c99a3b1613519b and fixed in 6.15-rc1 with commit 667f053b05f00a007738cd7ed6fa1901de19dc7e 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-2025-22031 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/pci/pcie/bwctrl.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/d93d309013e89631630a12b1770d27e4be78362a https://git.kernel.org/stable/c/1181924af78e5299ddec6e457789c02dd5966559 https://git.kernel.org/stable/c/667f053b05f00a007738cd7ed6fa1901de19dc7e