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 0A95D374C2 for ; Mon, 20 May 2024 09:43:51 +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=1716198232; cv=none; b=KDAcjsPBh/gOBz31ddso3xUcgvVsBW25a7KDT4mwkSB5AMslKUu4okP/YfH8BHosyuQjw60Z3pGZm0gn1W8PmWjSzj2SG6bDPVQ0AwD0rsYouF8aSydbvRSVESAfv/jtMSzMvGKxURR5+6GCYXKGC+OsIQUxeMp/OkCDVNkMSMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198232; c=relaxed/simple; bh=MMAbTTD9Q/ZCc5DwF534GHIf2nam/lVsSqj+jafSJ7s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=L2eoOBZdHWOzL8+t98TXvratZ1phWZcal8Wpw2Dtz+v1QKGDJDN5St5L5+Nknmee8XE7TihwP26dbEsmN0slswSmCTIEpnL34HcdU5Qo+VZ07YdsKOIk398/WpU4EFKdNdizYMY+yQ9HVYdIQWIPMXjZxdoDzmqsJd3pgTfNnDU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LGQcd3jK; 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="LGQcd3jK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3266FC2BD10; Mon, 20 May 2024 09:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716198231; bh=MMAbTTD9Q/ZCc5DwF534GHIf2nam/lVsSqj+jafSJ7s=; h=From:To:Cc:Subject:Date:Reply-to:From; b=LGQcd3jKCO1RI4aB/FEu21SqWZtv7WCwW6xgl3dWS/Z51tPnK000pJJOQIaQEq5KK +suBlibkr5KMsO9p+exfPD/F8PhRE6Ntf2NFtqauStTdzgV3XZpi2qUFaUZ8aBOosW asSRiIDy9pw7YK/hPjv/yUnzGemg2DX/awsocJ6c= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35957: iommu/vt-d: Fix WARN_ON in iommu probe path Date: Mon, 20 May 2024 11:42:22 +0200 Message-ID: <2024052019-CVE-2024-35957-8c83@gregkh> X-Mailer: git-send-email 2.45.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=3955; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=MMAbTTD9Q/ZCc5DwF534GHIf2nam/lVsSqj+jafSJ7s=; b=owGbwMvMwCRo6H6F97bub03G02pJDGneUr+LcsVnuf09c2hvR4uvG0/n5Uf3Vp41OlPQ/iDI2 k/kT5xiRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkXT7DHJ4tXWuY39m+fMm3 +f4Zi0yHv/ODGxnmR+rX7JulVbtDPd21vmXZejv5tpZIAA== 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: iommu/vt-d: Fix WARN_ON in iommu probe path Commit 1a75cc710b95 ("iommu/vt-d: Use rbtree to track iommu probed devices") adds all devices probed by the iommu driver in a rbtree indexed by the source ID of each device. It assumes that each device has a unique source ID. This assumption is incorrect and the VT-d spec doesn't state this requirement either. The reason for using a rbtree to track devices is to look up the device with PCI bus and devfunc in the paths of handling ATS invalidation time out error and the PRI I/O page faults. Both are PCI ATS feature related. Only track the devices that have PCI ATS capabilities in the rbtree to avoid unnecessary WARN_ON in the iommu probe path. Otherwise, on some platforms below kernel splat will be displayed and the iommu probe results in failure. WARNING: CPU: 3 PID: 166 at drivers/iommu/intel/iommu.c:158 intel_iommu_probe_device+0x319/0xd90 Call Trace: ? __warn+0x7e/0x180 ? intel_iommu_probe_device+0x319/0xd90 ? report_bug+0x1f8/0x200 ? handle_bug+0x3c/0x70 ? exc_invalid_op+0x18/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? intel_iommu_probe_device+0x319/0xd90 ? debug_mutex_init+0x37/0x50 __iommu_probe_device+0xf2/0x4f0 iommu_probe_device+0x22/0x70 iommu_bus_notifier+0x1e/0x40 notifier_call_chain+0x46/0x150 blocking_notifier_call_chain+0x42/0x60 bus_notify+0x2f/0x50 device_add+0x5ed/0x7e0 platform_device_add+0xf5/0x240 mfd_add_devices+0x3f9/0x500 ? preempt_count_add+0x4c/0xa0 ? up_write+0xa2/0x1b0 ? __debugfs_create_file+0xe3/0x150 intel_lpss_probe+0x49f/0x5b0 ? pci_conf1_write+0xa3/0xf0 intel_lpss_pci_probe+0xcf/0x110 [intel_lpss_pci] pci_device_probe+0x95/0x120 really_probe+0xd9/0x370 ? __pfx___driver_attach+0x10/0x10 __driver_probe_device+0x73/0x150 driver_probe_device+0x19/0xa0 __driver_attach+0xb6/0x180 ? __pfx___driver_attach+0x10/0x10 bus_for_each_dev+0x77/0xd0 bus_add_driver+0x114/0x210 driver_register+0x5b/0x110 ? __pfx_intel_lpss_pci_driver_init+0x10/0x10 [intel_lpss_pci] do_one_initcall+0x57/0x2b0 ? kmalloc_trace+0x21e/0x280 ? do_init_module+0x1e/0x210 do_init_module+0x5f/0x210 load_module+0x1d37/0x1fc0 ? init_module_from_file+0x86/0xd0 init_module_from_file+0x86/0xd0 idempotent_init_module+0x17c/0x230 __x64_sys_finit_module+0x56/0xb0 do_syscall_64+0x6e/0x140 entry_SYSCALL_64_after_hwframe+0x71/0x79 The Linux kernel CVE team has assigned CVE-2024-35957 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8.2 with commit c618d446f1d6 and fixed in 6.8.7 with commit fba8ca3e6f60 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-35957 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/iommu/intel/iommu.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/fba8ca3e6f608b92e54271fdbd3ce569361939fc https://git.kernel.org/stable/c/89436f4f54125b1297aec1f466efd8acb4ec613d