From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796183278; b=Id4q5elieCmrUSW5Oo/TlhxvfA9qmQR+GqZ1xtWO+YJeBbRD5quuTzNo6PcbUpbgiW// mXsZYyzEeAki/EUt3F2nTNAavYOTIR4k1ZUTPukYbXIeY+R3gxcFINFQW/aUG7+RI8nAK uEUwvdNppgf3ffA3JgCsNWyzeZLQR8NNwflkDA4nv+PDr1c/zcluN9p35Xh0zI46pummX 1n6bSd3LebyP8XK7EDz+FnR9OzzWcgWordLmSUTR6cFz+MTcm5R2mwG9f1aXX2phWut/1 RlR5n/sepdIwrIEhq2lOVq0d8VwJWCHY4x5qzA8qkZwA7NOZGgJqypqpm4LD48GqdVg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183278; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=8ZEOKOYOD+CbzdY8Wugv1u+HiwcpCMwTfboCBG+YpP0=; b=NMLVr+3Tl1o2nr9RPQzaxWFp+vlOaFbDLaevahkF8NVgqj5MYPYdGC6g+d46+wTL2ul2 +sNY5zRxS3D3X/bgGYVAbZxnc5QRVHZnGM0CvuAKnYJZom5rlp9VhoWNYymfzz+lcomNr n+J+fpuMNJJfdGHAKgqXnYVKs+eLaPn68Pu58vy88NGfmjG8G/9zmn+sb4ZcdOirqcNeW ykGENSGX5D0obxAPQ03yPm3S4WbtLx4BqjPWrwYfJRR1Hy2bjLsPQ4O/94AZ0ZEE/AsnG QLuVS1BTs9OvVZkUe/kCveqBySqUc7lZW/jTe/NUFe1Enok+YVNUArZOBQ+r0xzwPtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=LK763bSQ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35431606A322; Wed, 2 Dec 2026 03:47:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=LK763bSQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id E43681F000C1; Wed, 2 Dec 2026 03:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796183278; bh=8ZEOKOYOD+CbzdY8Wugv1u+HiwcpCMwTfboCBG+YpP0=; h=Date:To:From:In-Reply-To:References:Subject; b=LK763bSQ0tso8ecomUcoktllU7lHhSRC8NV5p1BgmroEvcoo0AsW5wT/tUt9nZrbk pSdENW7DAplLJiGEed3lVLyc6+6s8llIYFX5T9bJJBP2Em31UQAla7gr2OsA5V7gTx 9m0NIyrXOr6NmPpxL0nBgrNEnpWQE5m5LWR1WKew= Date: Tue, 01 Dec 2026 19:47:57 -0800 To: mm-commits@vger.kernel.org,ziy@nvidia.com,vbabka@kernel.org, thomas.hellstrom@linux.intel.com,stable@vger.kernel.org,sj@kernel.org, patchwork@emeril.freedesktop.org,mpenttil@redhat.com,matthew.brost@intel.com, ljs@kernel.org,leon@kernel.org,jgg@ziepe.ca,francois.dugast@intel.com, christian.koenig@amd.com,balbirs@nvidia.com,apopple@nvidia.com, akpm@linux-foundation.org,airlied@gmail.com,jm5905938@gmail.com From: Andrew Morton In-Reply-To: <179342234355.4.16705453209886955762@gmail.com> References: <179342234355.4.16705453209886955762@gmail.com> Subject: [merged mm-hotfixes-stable] mm-hmm-account-for-subpage-offsets-in-device-private-pmds.patch removed from -mm tree Message-Id: <20261202034757.E43681F000C1@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: mm/hmm: account for subpage offsets in device-private PMDs has been removed from the -mm tree. Its filename was mm-hmm-account-for-subpage-offsets-in-device-private-pmds.patch This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Aveline Noir Subject: mm/hmm: account for subpage offsets in device-private PMDs Date: Sat, 31 Oct 2026 15:07:58 +1100 When a query starts inside a device-private PMD owned by range->dev_private_owner, hmm_vma_handle_absent_pmd() still fills the PFN array from the folio's first page. The returned PFNs therefore refer to earlier pages rather than the requested subrange. Nouveau's GPU fault path can query one page of a device-private PMD at a time. Xe's SVM fault, prefetch and userptr mapping paths can also query subranges of their own device-private PMDs. An unprivileged process with access to the GPU render node can reach these paths on hardware supporting device-private THP migration. Xe can read the wrong application data or silently overwrite earlier pages of the same process's device-private folio. Nouveau aligns a one-page GPU fault to the PMD head by subtracting the fault offset from the returned page. The faulty HMM PFN already refers to the head, so this subtraction can select a page before the folio. If the preceding page belongs to another allocation, GPU access can expose or overwrite unrelated userspace data; an invalid page can also fault the kernel during its address conversion. This worst case follows from the source, but has not been demonstrated on a real GPU. Add the query's PMD-relative page offset to the initial PFN, as the present PMD path already does. The device-private PMD migration machinery first shipped in 6.19. Backport this fix to the maintained 7.3.y stable series; the HMM path exists in 6.18.y but cannot be reached through an in-tree PMD-producing device-private migration path there. Link: https://patch.msgid.link/179342234355.4.16705453209886955762@gmail.com Fixes: 10b9feee2d0d ("mm/hmm: populate PFNs from PMD swap entry") Signed-off-by: Aveline Noir Signed-off-by: Andrew Morton Tested-by: Andrew Morton Link: https://lore.kernel.org/20261121160037.1a479f3c8b4e860bc23c106d@linux-foundation.org Reviewed-by: Mika Penttilä Reviewed-by: Balbir Singh Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: Francois Dugast Cc: Lorenzo Stoakes Cc: Matthew Brost Cc: Patchwork Cc: SJ Park Cc: Vlastimil Babka Cc: David Airlie Cc: Alistair Popple Cc: Christian König Cc: Thomas Hellström Cc: Zi Yan Cc: mm/hmm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/hmm.c~mm-hmm-account-for-subpage-offsets-in-device-private-pmds +++ a/mm/hmm.c @@ -355,7 +355,8 @@ static int hmm_vma_handle_absent_pmd(str range->dev_private_owner) { unsigned long cpu_flags = HMM_PFN_VALID | hmm_pfn_flags_order(PMD_SHIFT - PAGE_SHIFT); - unsigned long pfn = softleaf_to_pfn(entry); + unsigned long pfn = softleaf_to_pfn(entry) + + ((start & ~PMD_MASK) >> PAGE_SHIFT); unsigned long i; if (softleaf_is_device_private_write(entry)) _ Patches currently in -mm which might be from jm5905938@gmail.com are mm-damon-sysfs-skip-registration-if-damon-core-init-fails.patch mm-damon-ops-common-align-mmu-notifier-range-when-clearing-pmd-young-bit.patch mm-damon-stat-avoid-32-bit-overflow-in-idle-percentiles.patch mm-damon-pvaddr-skip-folios-already-on-the-migration-target-node.patch docs-admin-guide-mm-damon-start-fix-grammar.patch docs-admin-guide-mm-damon-stat-fix-pronoun-agreement.patch docs-admin-guide-mm-damon-usage-fix-grammar.patch docs-admin-guide-mm-damon-lru_sort-fix-remaining-grammar.patch docs-mm-damon-design-fix-grammar-and-typos.patch docs-mm-damon-api-fix-verb-form.patch docs-mm-damon-maintainer-profile-fix-subject-verb-agreement.patch docs-mm-damon-monitoring_intervals_tuning_example-fix-grammar-and-typos.patch mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion.patch mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix.patch mm-damon-paddr-skip-non-lru-folios-as-a-whole-in-pageout.patch mm-damon-core-skip-apply_probes-when-no-probes-are-installed.patch selftests-damon-damos_quota-skip-the-last-sample-when-counting-exceeds.patch mm-hugetlb-serialize-subpool-release-with-folio-reserve-restoration.patch