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 9206835CEC4 for ; Thu, 11 Sep 2025 16:57:28 +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=1757609848; cv=none; b=fK5Gd/U8RMuwTF6dyZ/wESrT72/jEeeq9lIhglR5vhymul2L15BvyShXd5pjN9a2d2aE2BlJLYyed1MEhZaCR4yg/yALUmZtODTRV8/Kr72c5McLBYMDAsSVYfecGWtrNJCr7SppZ/3zI1NmbQohP5S52etB7b1psT6HEiy7jhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757609848; c=relaxed/simple; bh=0W9zTPaFWefyzAShPUEjfOxh8GJ8oX9g9/cBpnR3t0I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GSrcAvtRlsOHaPyYeqowpLM8hZ/2Z59WMS0WLhNPVjHwxgv4U1fEKdbvkA8TojCl3S1J1O0Loxgdkp/CbCA3oYemDuUdcek6+n0wUq+Qn25iSNWOY2pUH4opR1JuVGG0ivjKKB/bytdGnSueoBltxbvQLsfVMjbfPWuLyCj+INk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MCMoRQbD; 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="MCMoRQbD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02778C4CEF0; Thu, 11 Sep 2025 16:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757609848; bh=0W9zTPaFWefyzAShPUEjfOxh8GJ8oX9g9/cBpnR3t0I=; h=From:To:Cc:Subject:Date:Reply-to:From; b=MCMoRQbDjLY+LIW/PKJi9HA8O3o9A1q6IhMSLwm5Z9y6CEE2G/7wZhu2NoL/bG7dJ TDrH/0gDRiXbXopQx4mnEqRpVkuw0F/Zen+qlXRJUNOB2nq9IENnt0pGnsPIBxdMkS JYggmgnreP6BShClo3EDTynZR4bMf5Rc64mNmlt4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39784: PCI: Fix link speed calculation on retrain failure Date: Thu, 11 Sep 2025 18:57:02 +0200 Message-ID: <2025091150-CVE-2025-39784-7851@gregkh> X-Mailer: git-send-email 2.51.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=2819; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=642bARQiBPieFnFUM6ryWfJHJrxHCl33i4xDSy3n84M=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmH/ge1TN8VwCvz0PRQ74G/78xjV51KDRZgOH1WS6HgT 2h0QldnRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzEbDHDTMZMxYf76vmFzWI/ Z07a8nXizHusfgzzS9u0Dsc3KJ5/yJu5wchGSXlW7hMOAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: PCI: Fix link speed calculation on retrain failure When pcie_failed_link_retrain() fails to retrain, it tries to revert to the previous link speed. However it calculates that speed from the Link Control 2 register without masking out non-speed bits first. PCIE_LNKCTL2_TLS2SPEED() converts such incorrect values to PCI_SPEED_UNKNOWN (0xff), which in turn causes a WARN splat in pcie_set_target_speed(): pci 0000:00:01.1: [1022:14ed] type 01 class 0x060400 PCIe Root Port pci 0000:00:01.1: broken device, retraining non-functional downstream link at 2.5GT/s pci 0000:00:01.1: retraining failed WARNING: CPU: 1 PID: 1 at drivers/pci/pcie/bwctrl.c:168 pcie_set_target_speed RDX: 0000000000000001 RSI: 00000000000000ff RDI: ffff9acd82efa000 pcie_failed_link_retrain pci_device_add pci_scan_single_device Mask out the non-speed bits in PCIE_LNKCTL2_TLS2SPEED() and PCIE_LNKCAP_SLS2SPEED() so they don't incorrectly return PCI_SPEED_UNKNOWN. [bhelgaas: commit log, add details from https://lore.kernel.org/r/1c92ef6bcb314ee6977839b46b393282e4f52e74.1750684771.git.lukas@wunner.de] The Linux kernel CVE team has assigned CVE-2025-39784 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit de9a6c8d5dbfedb5eb3722c822da0490f6a59a45 and fixed in 6.16.4 with commit 16557320f378262b5c605b15edebd3642406992a Issue introduced in 6.13 with commit de9a6c8d5dbfedb5eb3722c822da0490f6a59a45 and fixed in 6.17-rc1 with commit 9989e0ca7462c62f93dbc62f684448aa2efb9226 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-39784 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/pci.h 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/16557320f378262b5c605b15edebd3642406992a https://git.kernel.org/stable/c/9989e0ca7462c62f93dbc62f684448aa2efb9226