From mboxrd@z Thu Jan 1 00:00:00 1970 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 D665E2750E6; Mon, 9 Feb 2026 14:56:03 +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=1770648963; cv=none; b=MYHhxgsD+4/bJvvKbbLg3wcAyBWiVu0rtbo3aAcF1yqsqFPvF0PI0i1sbw1QDPPgTpN0G8z8HDgd5iuxqUHHMNiKVO8plBBwJXu3aCLFbLC/AdqxBF+ZtMPnTS+TlnnoF0WUUK8aVac1TKjpPE8AT8yMcRhmsABHlkD2T4T3Izg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648963; c=relaxed/simple; bh=MA+HgbCO9WJCqzJlS4J6SC80uA9JxZxqm/v+sGvZWQs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZH6yTiW2OOGT9bI4bj1Cw58xJ8MAAh0grGyuPAsxKp2MRkmFl1UUxlrpH96Cm98/hjPI5/BpDNxMRqak81MQh8WtImO7/1crOru2mAT+x5dtqizNPJELySoOuCKaPDJ6292a5xkjzILuoXl1eGYMPySSomyf13a9Fvg5Kkflpow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ixGU3ywc; 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="ixGU3ywc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 347ECC116C6; Mon, 9 Feb 2026 14:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648963; bh=MA+HgbCO9WJCqzJlS4J6SC80uA9JxZxqm/v+sGvZWQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixGU3ywcVnsMW7QPJBwq1CrtAvWFNSCLfLEQu2OXGy4rw9WrzXor444TR61tomk1e xSELl8A7X7laF1gh6w7Hp324yWd4ZLOVTBQPZ6NuvvatOx/i04uyqN8DE4AcGV1W98 MpCT5ylqIwXVkbxsSfICvl2Iwr3OX0W8kCdb53r4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, 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 (Oracle)" , 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 68/75] iommu: disable SVA when CONFIG_X86 is set Date: Mon, 9 Feb 2026 15:25:05 +0100 Message-ID: <20260209142304.299268555@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142301.830618238@linuxfoundation.org> References: <20260209142301.830618238@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lu Baolu commit 72f98ef9a4be30d2a60136dd6faee376f780d06c upstream. 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.intel.com Link: https://lkml.kernel.org/r/20251022082635.2462433-2-baolu.lu@linux.intel.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 Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/iommu.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -3068,6 +3068,9 @@ iommu_sva_bind_device(struct device *dev if (!group) return ERR_PTR(-ENODEV); + 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);