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 D0A2C1F6696 for ; Fri, 27 Dec 2024 15:07:32 +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=1735312052; cv=none; b=GQ34HylFJelNQaJ1bxjqTJxRpwX68QZcqGMcSCa/SGPJSgxLkp9pPppp0dNW5M10Ye380V5Hh7BoZ2eJCtqodzc1+IBuFi9QVnERSkYpxdZFT476ByMqc5lm3nF1UjWcO/09b3D1GAs+yEtd0Xa1aLPIAEXLOp7JCB75GgCu37A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735312052; c=relaxed/simple; bh=PuySM/gFMjczZXt2qpPRll9VkqwFiIRZMyH05ulUpBY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BMoQA4ZbY2CFRasOetnM2AOxSWzkTnYan5h9o6DNWKzf/e51GSESZmkans530BNebZKU9daiv3Of64nhwWVGKOL2M0546gwCVu9su8gcBJTatHsP9VMZanRxh4FFZNxyjMz0ysPYckE614+MGNHLL68sBt72fKK2/VsksYrxTEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=P7aaslNH; 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="P7aaslNH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3559DC4CED7; Fri, 27 Dec 2024 15:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735312052; bh=PuySM/gFMjczZXt2qpPRll9VkqwFiIRZMyH05ulUpBY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=P7aaslNHkY3O7Hxdd1gvi7M08/83VJ444IbvZFJa45V7arRgTC+rWiSdQO8OvFtb6 U5f8IDqvLjVepBVxJwAfSSwbAmtFXrGl45KsGfR8PV+k2/oXLJv14952Y3PmR1HBhX Jsk3sbXcxdu3MSX/HVZZYENhozY2VpQQ1YPOEcmA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56669: iommu/vt-d: Remove cache tags before disabling ATS Date: Fri, 27 Dec 2024 16:07:06 +0100 Message-ID: <2024122754-CVE-2024-56669-2ea9@gregkh> X-Mailer: git-send-email 2.47.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=3048; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PuySM/gFMjczZXt2qpPRll9VkqwFiIRZMyH05ulUpBY=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5h/psX/Xese0o4tFs2Hu3Pfbfu+71bwSPHS3865ue/ Sn9SUNDRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkQyDDPPPW7TkKC5bZas5c mv818snp3TnPnjEsOJi/7JTo/wc3j35a8HPfO7FS5v5vzwA= 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: Remove cache tags before disabling ATS The current implementation removes cache tags after disabling ATS, leading to potential memory leaks and kernel crashes. Specifically, CACHE_TAG_DEVTLB type cache tags may still remain in the list even after the domain is freed, causing a use-after-free condition. This issue really shows up when multiple VFs from different PFs passed through to a single user-space process via vfio-pci. In such cases, the kernel may crash with kernel messages like: BUG: kernel NULL pointer dereference, address: 0000000000000014 PGD 19036a067 P4D 1940a3067 PUD 136c9b067 PMD 0 Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 74 UID: 0 PID: 3183 Comm: testCli Not tainted 6.11.9 #2 RIP: 0010:cache_tag_flush_range+0x9b/0x250 Call Trace: ? __die+0x1f/0x60 ? page_fault_oops+0x163/0x590 ? exc_page_fault+0x72/0x190 ? asm_exc_page_fault+0x22/0x30 ? cache_tag_flush_range+0x9b/0x250 ? cache_tag_flush_range+0x5d/0x250 intel_iommu_tlb_sync+0x29/0x40 intel_iommu_unmap_pages+0xfe/0x160 __iommu_unmap+0xd8/0x1a0 vfio_unmap_unpin+0x182/0x340 [vfio_iommu_type1] vfio_remove_dma+0x2a/0xb0 [vfio_iommu_type1] vfio_iommu_type1_ioctl+0xafa/0x18e0 [vfio_iommu_type1] Move cache_tag_unassign_domain() before iommu_disable_pci_caps() to fix it. The Linux kernel CVE team has assigned CVE-2024-56669 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 3b1d9e2b2d6856eabf5faa12d20c97fef657999f and fixed in 6.12.6 with commit 9a0a72d3ed919ebe6491f527630998be053151d8 Issue introduced in 6.10 with commit 3b1d9e2b2d6856eabf5faa12d20c97fef657999f and fixed in 6.13-rc3 with commit 1f2557e08a617a4b5e92a48a1a9a6f86621def18 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-56669 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/9a0a72d3ed919ebe6491f527630998be053151d8 https://git.kernel.org/stable/c/1f2557e08a617a4b5e92a48a1a9a6f86621def18