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 9C1F117A2F1 for ; Thu, 27 Feb 2025 02:13:12 +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=1740622392; cv=none; b=pdk3GQyGAZjP0XSzRV2UrHbUH3dcXTE7jd4hqZFURSSCnGliTynV3WnEmIDyjZmZ7NSHhhgIvE3JHmkV/+p3kewG6FQC1I1iNePEpnaJi9pt5q15sVUN8u3kUYTtvYgG57nf0gQIMGQtJjBKW6vVxFUPUVxIHrj8vtha4Y5FuMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740622392; c=relaxed/simple; bh=IlABTa3Hg8LvOyIJy6H15961bfq8DfpUUEKaExJ+3V0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gYB3TWULcMKCKrCwDvsg56beAIr5xYqU/8QTC1Qd6AXfK06lRk1blIp7ItfTCxGe8BlitX4P++zEpnsiOT6MNYu3rwPipdZgxOY06+UNC1QfML6pVF/9lliTzOtetJbKjKDmBw4V6tPomurBfS6i8k7xNSQ580mA4mNzhfaNYsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ygpX8A/F; 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="ygpX8A/F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FC01C4CED6; Thu, 27 Feb 2025 02:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740622392; bh=IlABTa3Hg8LvOyIJy6H15961bfq8DfpUUEKaExJ+3V0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ygpX8A/FKnnYNvsY3+FW1vrD+6H4naxwXXiPN+gfy8whAK52Yz12f2tkdYy4/G91/ +Ll27ouvaY2TWhtm3r1m0VcFIE8+laQDN2lIGX4RGOVa0KdB7alSrWBNtoFAvDhpkX 2NfRWCmTu/jViMf0qb7yglZjjGuwOx2WlASY8kWI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-58006: PCI: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar() Date: Wed, 26 Feb 2025 18:11:00 -0800 Message-ID: <2025022655-CVE-2024-58006-9855@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=3054; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=IlABTa3Hg8LvOyIJy6H15961bfq8DfpUUEKaExJ+3V0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7T66/2xq1225v9yEx1f8TL6xJKu2dduGY4pqnEmJx3 0rS7xhFdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEJnEzLOh8UDRvhYv1zN77 0pNfMYWnPz6ff5ZhDnfmnfu/1njFlV5tDMmYaTP7doJyPAA= 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: dwc: ep: Prevent changing BAR size/flags in pci_epc_set_bar() In commit 4284c88fff0e ("PCI: designware-ep: Allow pci_epc_set_bar() update inbound map address") set_bar() was modified to support dynamically changing the backing physical address of a BAR that was already configured. This means that set_bar() can be called twice, without ever calling clear_bar() (as calling clear_bar() would clear the BAR's PCI address assigned by the host). This can only be done if the new BAR size/flags does not differ from the existing BAR configuration. Add these missing checks. If we allow set_bar() to set e.g. a new BAR size that differs from the existing BAR size, the new address translation range will be smaller than the BAR size already determined by the host, which would mean that a read past the new BAR size would pass the iATU untranslated, which could allow the host to read memory not belonging to the new struct pci_epf_bar. While at it, add comments which clarifies the support for dynamically changing the physical address of a BAR. (Which was also missing.) The Linux kernel CVE team has assigned CVE-2024-58006 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 4284c88fff0efc4e418abb53d78e02dc4f099d6c and fixed in 6.12.14 with commit b5cacfd067060c75088363ed3e19779078be2755 Issue introduced in 6.0 with commit 4284c88fff0efc4e418abb53d78e02dc4f099d6c and fixed in 6.13.3 with commit 3229c15d6267de8e704b4085df8a82a5af2d63eb Issue introduced in 6.0 with commit 4284c88fff0efc4e418abb53d78e02dc4f099d6c and fixed in 6.14-rc1 with commit 3708acbd5f169ebafe1faa519cb28adc56295546 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-58006 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/controller/dwc/pcie-designware-ep.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/b5cacfd067060c75088363ed3e19779078be2755 https://git.kernel.org/stable/c/3229c15d6267de8e704b4085df8a82a5af2d63eb https://git.kernel.org/stable/c/3708acbd5f169ebafe1faa519cb28adc56295546