From nobody Mon Feb 9 16:51:41 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (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 CD1C51DF73A; Mon, 9 Feb 2026 05:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770613661; cv=none; b=M5jZfiQnx1qyC5rZORyvAA7zALH/Nx/n9D2BuObiyM8w6O4v/QfeZQ7K2S6DrL2W5jRjIvdOdiAy8X+G+jnOENGqahHz+6TDqQisOsQRhQMpRxRGTU8HU5n56fmPAGdRt/TxXQ3Npk4zyc7eYP1cHKRHbIdejghYOi4j1Bqcfhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770613661; c=relaxed/simple; bh=LHqn/GixCBjCcP0ckY9K5G7256wn5lQHJeRBARtN12I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=j991223XxDFMZIZn8/Fe1pbYfDcLmqqRbqEEF9W54Th9wF2x4Xm2PZFWtBNVL7HUy+ZvA0HIMOcjQxiY3chkWTIvptHcuDLs8e/Pg+RUGF6dcONXZKMMy8qnF3XhTwaDotiWvsOWrg5BsIa68vTGT5YzcrOvab+fxDss/1maEVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=AlAGa2Is; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="AlAGa2Is" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=/x fz2yEJLYMm2Um+zvW1kTIww6qHXcYAehjSQux+ryA=; b=AlAGa2IsDDjO7PiU8u lvJLZnvQ5EhJcbpZNHny8+lo0vE88r8xkg0IAujk3AkpQETMLSwyHs3ZtIefrZdX 6Epq8J7vMb6/hmmocH9e8R9wBWgfUE49P9mzL1WQk8koweZrq4fKFgTgAOIHESm7 1fw033K3kdKVjur+1EStJBCnA= Received: from pek-lpg-core6.wrs.com (unknown []) by gzsmtp5 (Coremail) with SMTP id QCgvCgCXAnWkaolpRukVOg--.391S2; Mon, 09 Feb 2026 13:03:34 +0800 (CST) From: Rahul Sharma To: gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe , Alistair Popple , Andy Lutomirski , Borislav Betkov , Dave Hansen , David Hildenbrand , Ingo Molnar , Jann Horn , Jean-Philippe Brucker , Joerg Roedel , Kevin Tian , Liam Howlett , Lorenzo Stoakes , Matthew Wilcox , Michal Hocko , Mike Rapoport , Peter Zijlstra , Robin Murohy , Thomas Gleinxer , "Uladzislau Rezki (Sony)" , Vasant Hegde , Vinicius Costa Gomes , Vlastimil Babka , Will Deacon , Yi Lai , Andrew Morton , Rahul Sharma Subject: [PATCH 5.15.y] iommu: disable SVA when CONFIG_X86 is set Date: Mon, 9 Feb 2026 13:03:30 +0800 Message-Id: <20260209050330.3918880-1-black.hawk@163.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: QCgvCgCXAnWkaolpRukVOg--.391S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxGFyUWrW3Kry8JryrXw4Utwb_yoW7Gr13pF WUGrWSyryDJr1rCw1Duayv9Fyjg398GFWUGFn8G3Z5uryakryjvr1a9F4fXFWUKryDGF1a vF4qgr1xtayFv3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pEqg43UUUUU= X-CM-SenderInfo: 5eoduy4okd4yi6rwjhhfrp/xtbC+giBG2mJaqgzaAAA3R Content-Type: text/plain; charset="utf-8" From: Lu Baolu [ Upstream commit 72f98ef9a4be30d2a60136dd6faee376f780d06c ] Patch series "Fix stale IOTLB entries for kernel address space", v7. This proposes a fix for a security vulnerability related to IOMMU Shared Virtual Addressing (SVA). In an SVA context, an IOMMU can cache kernel page table entries. When a kernel page table page is freed and reallocated for another purpose, the IOMMU might still hold stale, incorrect entries. This can be exploited to cause a use-after-free or write-after-free condition, potentially leading to privilege escalation or data corruption. This solution introduces a deferred freeing mechanism for kernel page table pages, which provides a safe window to notify the IOMMU to invalidate its caches before the page is reused. This patch (of 8): In the IOMMU Shared Virtual Addressing (SVA) context, the IOMMU hardware shares and walks the CPU's page tables. The x86 architecture maps the kernel's virtual address space into the upper portion of every process's page table. Consequently, in an SVA context, the IOMMU hardware can walk and cache kernel page table entries. The Linux kernel currently lacks a notification mechanism for kernel page table changes, specifically when page table pages are freed and reused. The IOMMU driver is only notified of changes to user virtual address mappings. This can cause the IOMMU's internal caches to retain stale entries for kernel VA. Use-After-Free (UAF) and Write-After-Free (WAF) conditions arise when kernel page table pages are freed and later reallocated. The IOMMU could misinterpret the new data as valid page table entries. The IOMMU might then walk into attacker-controlled memory, leading to arbitrary physical memory DMA access or privilege escalation. This is also a Write-After-Free issue, as the IOMMU will potentially continue to write Accessed and Dirty bits to the freed memory while attempting to walk the stale page tables. Currently, SVA contexts are unprivileged and cannot access kernel mappings. However, the IOMMU will still walk kernel-only page tables all the way down to the leaf entries, where it realizes the mapping is for the kernel and errors out. This means the IOMMU still caches these intermediate page table entries, making the described vulnerability a real concern. Disable SVA on x86 architecture until the IOMMU can receive notification to flush the paging cache before freeing the CPU kernel page table pages. Link: https://lkml.kernel.org/r/20251022082635.2462433-1-baolu.lu@linux.int= el.com Link: https://lkml.kernel.org/r/20251022082635.2462433-2-baolu.lu@linux.int= el.com Fixes: 26b25a2b98e4 ("iommu: Bind process address spaces to devices") Signed-off-by: Lu Baolu Suggested-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe Cc: Alistair Popple Cc: Andy Lutomirski Cc: Borislav Betkov Cc: Dave Hansen Cc: David Hildenbrand Cc: Ingo Molnar Cc: Jann Horn Cc: Jean-Philippe Brucker Cc: Joerg Roedel Cc: Kevin Tian Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Robin Murohy Cc: Thomas Gleinxer Cc: "Uladzislau Rezki (Sony)" Cc: Vasant Hegde Cc: Vinicius Costa Gomes Cc: Vlastimil Babka Cc: Will Deacon Cc: Yi Lai Cc: Signed-off-by: Andrew Morton [ The context change is due to the commit be51b1d6bbff ("iommu/sva: Refactoring iommu_sva_bind/unbind_device()") and the commit 757636ed2607 ("iommu: Rename iommu-sva-lib.{c,h}") in v6.2 which are irrelevant to the logic of this patch. ] Signed-off-by: Rahul Sharma --- drivers/iommu/iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 01e01ca760cf..964170f90597 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -3068,6 +3068,9 @@ iommu_sva_bind_device(struct device *dev, struct mm_s= truct *mm, void *drvdata) if (!group) return ERR_PTR(-ENODEV); =20 + if (IS_ENABLED(CONFIG_X86)) + return ERR_PTR(-EOPNOTSUPP); + /* Ensure device count and domain don't change while we're binding */ mutex_lock(&group->mutex); =20 --=20 2.34.1