From: sashiko-bot@kernel.org
To: "Zi Yan" <ziy@nvidia.com>, "David Hildenbrand" <david@kernel.org>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <liam@infradead.org>,
"Nico Pache" <nico.pache@linux.dev>,
"Ryan Roberts" <ryan.roberts@arm.com>,
"Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>,
"Lance Yang" <lance.yang@linux.dev>,
"Usama Arif" <usama.arif@linux.dev>,
"Kiryl Shutsemau" <kas@kernel.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Rik van Riel" <riel@surriel.com>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Harry Yoo" <harry@kernel.org>, "Jann Horn" <jannh@google.com>,
"Kyle Zeng" <kylebot@openai.com>,
"Andrew Morton" <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, "Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>,
"John Hubbard" <jhubbard@nvidia.com>,
"Peter Xu" <peterx@redhat.com>, "Jason Gunthorpe" <jgg@ziepe.ca>
Subject: Re: [PATCH v2 4/9] LoongArch: mm: don't let GUP-fast follow invalidated THP PMDs
Date: Sat, 05 Dec 2026 04:19:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-251072@kernel.org> (raw)
In-Reply-To: <20261203-anon_vma_uaf_fix-v2-4-3d4c746e8839@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] LoongArch: mm: missing Fixes trailer for commit ddc1729b07cc
--
commit 58bf1239853f23352ee5f954933f2c215b85b155
Author: Zi Yan <ziy@nvidia.com>
> LoongArch: mm: don't let GUP-fast follow invalidated THP PMDs
>
> pmdp_invalidate() does not change a PMD to make pmd_present() returns
> false. So the generic pmd_access_permitted() returns true for an
> invalidated PMD. This allows GUP-fast to grab a reference on the folio.
>
> Code that invalidates a PMD and then decides whether it may drop the
> mapping relies on GUP-fast backing off from an invalidated PMD. x86, arm64
> and powerpc already reject invalidated PMDs in pmd_access_permitted().
>
> Provide a LoongArch pmd_access_permitted() that requires _PAGE_PRESENT,
> so invalidated (and PROT_NONE) PMDs are not followed by GUP-fast.
>
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> To: Huacai Chen <chenhuacai@kernel.org>
> Cc: WANG Xuerui <kernel@xen0n.name>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: John Hubbard <jhubbard@nvidia.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: loongarch@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
[Severity: Low]
This fixes a bug introduced when pmd_mkinvalid() and pmd_present() started
using _PAGE_PRESENT_INVALID without an arch-specific pmd_access_permitted().
Should this include:
Fixes: ddc1729b07cc ("LoongArch: Let pmd_present() return true when splitting pmd")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-anon_vma_uaf_fix-v2-0-3d4c746e8839@nvidia.com?part=4
next prev parent reply other threads:[~2026-12-05 4:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 4:17 [PATCH v2 0/9] Re-enable discarding lazyfree PMD THPs and transient none PMD fixes Zi Yan
2026-12-04 4:17 ` [PATCH v2 1/9] mm/migrate: do not clear device private entry in set_pmd_migration_entry() Zi Yan
2026-12-05 4:06 ` Lance Yang
2026-12-04 4:17 ` [PATCH v2 2/9] powerpc/book3s64/mm: don't count invalidated PMDs in page table check Zi Yan
2026-12-04 4:17 ` [PATCH v2 3/9] riscv: mm: don't let GUP-fast follow entries without _PAGE_READ Zi Yan
2026-12-04 4:17 ` [PATCH v2 4/9] LoongArch: mm: don't let GUP-fast follow invalidated THP PMDs Zi Yan
2026-12-05 4:19 ` sashiko-bot [this message]
2026-12-04 4:17 ` [PATCH v2 5/9] s390/mm: always clear _SEGMENT_ENTRY_READ in pmdp_invalidate() Zi Yan
2026-12-04 12:31 ` Alexander Gordeev
2026-12-04 4:17 ` [PATCH v2 6/9] sparc64: mm: fix thp_pte_count accounting around pmdp_invalidate() Zi Yan
2026-12-04 4:17 ` [PATCH v2 7/9] mm/huge_memory: avoid transient none PMDs during lazyfree reclaim Zi Yan
2026-12-04 4:35 ` Liam R. Howlett
2026-12-04 9:38 ` Baolin Wang
2026-12-04 13:23 ` Lorenzo Stoakes (ARM)
2026-12-05 4:19 ` sashiko-bot
2026-12-05 4:35 ` Lance Yang
2026-12-04 4:17 ` [PATCH v2 8/9] mm/rmap: re-enable discarding lazyfree THPs at PMD level Zi Yan
2026-12-04 4:37 ` Liam R. Howlett
2026-12-04 9:49 ` Baolin Wang
2026-12-05 4:19 ` sashiko-bot
2026-12-04 4:17 ` [PATCH v2 9/9] userfaultfd: avoid transient none PMDs during UFFDIO_MOVE Zi Yan
2026-12-04 12:52 ` Lorenzo Stoakes (ARM)
2026-12-05 4:19 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-251072@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=chenhuacai@kernel.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=harry@kernel.org \
--cc=jannh@google.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=kas@kernel.org \
--cc=kernel@xen0n.name \
--cc=kylebot@openai.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=nico.pache@linux.dev \
--cc=peterx@redhat.com \
--cc=riel@surriel.com \
--cc=ryan.roberts@arm.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox