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 5569B1A2C29 for ; Fri, 17 May 2024 14:40: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=1715956828; cv=none; b=QQUXiI7lbcnZKmvbNv1gWoWjQtFRUzc57ERsJbgZxb4+Rs2YUJNxjjYYEqRXlCWVTImvfHGOvEIlTZ5oCxtqcDHfUAsjb+P0bYo432tPCoAa84QMVTQJgBETFVRAc7rJU/6H3US2Qpm/D0fIFBnHrjhapfAVQtC1metIuzEdSL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715956828; c=relaxed/simple; bh=7L7n8QkRYwbkr0ZDepcoIXR+6xV7G2+DfHHGS738SvQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=svZWQOpSrsJt0n1XyX2NYD1U+Zvgi+V8xd3lNQTNAyWgcRfzyg2XKaGnqqkZF2ljqaGmIPD2uxfvcKbqwMiW0LNLwanWngWQiRjZCYGpvnmgJSWmAOQapEbjulQ48n2G2w0gB4iqyLOhc9BqXATJsTNL49suAOV+Rq5DfDmRWBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ofu1Y7pE; 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="Ofu1Y7pE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90606C2BD10; Fri, 17 May 2024 14:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715956827; bh=7L7n8QkRYwbkr0ZDepcoIXR+6xV7G2+DfHHGS738SvQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Ofu1Y7pEpl+K/UPjS+hyUNurHgB+7PyscjFtL+Ird/pmgJ8OPhZEekBOsABkzjhfo eYxK4Se2HYGdG3mY4EK3dFcGVIfn/hRSoprIPVWqVrgkARwUZWd/OOr1JQj8+mmk55 uKM9iCunnkOGC8mCZOdpjFEFd1xZUecCRZCzzGX0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35843: iommu/vt-d: Use device rbtree in iopf reporting path Date: Fri, 17 May 2024 16:40:18 +0200 Message-ID: <2024051717-CVE-2024-35843-516e@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=2545; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7L7n8QkRYwbkr0ZDepcoIXR+6xV7G2+DfHHGS738SvQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnuOYHaEjGXOy/rn4zbvvz2jm5XbZ3K88dlTsevzaqpu V5Q5D+xI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZikc+w4MBENp3Skv78yD2X POp6fqx58WO5IsP8LMf1O24xicxdZLLeW2D6isCjj85ZAAA= 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: Use device rbtree in iopf reporting path The existing I/O page fault handler currently locates the PCI device by calling pci_get_domain_bus_and_slot(). This function searches the list of all PCI devices until the desired device is found. To improve lookup efficiency, replace it with device_rbtree_find() to search the device within the probed device rbtree. The I/O page fault is initiated by the device, which does not have any synchronization mechanism with the software to ensure that the device stays in the probed device tree. Theoretically, a device could be released by the IOMMU subsystem after device_rbtree_find() and before iopf_get_dev_fault_param(), which would cause a use-after-free problem. Add a mutex to synchronize the I/O page fault reporting path and the IOMMU release device path. This lock doesn't introduce any performance overhead, as the conflict between I/O page fault reporting and device releasing is very rare. The Linux kernel CVE team has assigned CVE-2024-35843 to this issue. Affected and fixed versions =========================== Fixed in 6.8.2 with commit 3d39238991e7 Fixed in 6.9 with commit def054b01a86 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-35843 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/dmar.c drivers/iommu/intel/iommu.c drivers/iommu/intel/iommu.h drivers/iommu/intel/svm.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/3d39238991e745c5df85785604f037f35d9d1b15 https://git.kernel.org/stable/c/def054b01a867822254e1dda13d587f5c7a99e2a