From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,stable@vger.kernel.org,rppt@kernel.org,
ljs@kernel.org,leon@kernel.org,kas@kernel.org,jgg@ziepe.ca,jgg@nvidia.com,
david@kernel.org,dave.hansen@linux.intel.com,bp@alien8.de,gourry@gourry.net,
akpm@linux-foundation.org
Subject: + mm-hmm-reject-shadow-stack-mappings.patch added to mm-new branch
Date: Fri, 13 Nov 2026 18:10:33 -0800 [thread overview]
Message-ID: <20261114021034.29D411F000C7@smtp.kernel.org> (raw)
The patch titled
Subject: mm/hmm: reject shadow-stack mappings
has been added to the -mm mm-new branch. Its filename is
mm-hmm-reject-shadow-stack-mappings.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hmm-reject-shadow-stack-mappings.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: "Gregory Price (Meta)" <gourry@gourry.net>
Subject: mm/hmm: reject shadow-stack mappings
Date: Fri, 13 Nov 2026 14:55:36 -0500
On x86, a shadow-stack PTE has its ordinary write bit clear. The CPU
rejects ordinary stores to it, but pte_write() reports it writable because
shadow-stack instructions can write it. HMM consequently sets
HMM_PFN_WRITE, which Nouveau turns into ordinary GPU write permission. A
process with GPU access can then overwrite its own shadow stack,
potentially corrupting return addresses or bypassing that protection.
Reject shadow-stack VMAs in hmm_vma_walk_test(), including read access. A
requested fault returns -EFAULT; a snapshot records HMM_PFN_ERROR.
Link: https://lore.kernel.org/20261113195536.2660763-1-gourry@gourry.net
Link: https://lore.kernel.org/linux-mm/20261111-mason-migrate-et-al-fixes-v1-10-3d2454362e8d@kernel.org/
Fixes: 54007f818206 ("mm: Introduce VM_SHADOW_STACK for shadow stack memory")
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: <stable@vger.kernel.org>
---
mm/hmm.c | 3 +++
1 file changed, 3 insertions(+)
--- a/mm/hmm.c~mm-hmm-reject-shadow-stack-mappings
+++ a/mm/hmm.c
@@ -596,6 +596,7 @@ static int hmm_vma_walk_test(unsigned lo
struct vm_area_struct *vma = walk->vma;
if (!(vma->vm_flags & (VM_IO | VM_PFNMAP)) &&
+ !vma_test_single_mask(vma, VMA_SHADOW_STACK) &&
vma->vm_flags & VM_READ)
return 0;
@@ -607,6 +608,8 @@ static int hmm_vma_walk_test(unsigned lo
* allow write access either. HMM does not support architectures that
* allow write without read.
*
+ * Devices must not gain ordinary write access to shadow stacks.
+ *
* If a fault is requested for an unsupported range then it is a hard
* failure.
*/
_
Patches currently in -mm which might be from gourry@gourry.net are
mm-memory-tiers-reset-demotion-targets-of-nodes-without-memory.patch
mm-mempolicy-convert-mempolicy-refcnt-to-refcount_t.patch
selftests-mm-add-madv_cold-and-madv_pageout-contract-tests.patch
selftests-mm-check-madv_cold-and-madv_pageout-range-handling.patch
selftests-mm-check-that-madv_cold-and-madv_pageout-reject-hugetlb.patch
selftests-mm-check-that-madv_cold-and-madv_pageout-preserve-shared-memory.patch
selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps.patch
selftests-mm-check-madv_pageout-file-permissions.patch
selftests-mm-check-that-unauthorized-madv_pageout-skips-large-file-folios.patch
mm-hmm-reject-shadow-stack-mappings.patch
reply other threads:[~2026-11-14 2:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261114021034.29D411F000C7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=jgg@nvidia.com \
--cc=jgg@ziepe.ca \
--cc=kas@kernel.org \
--cc=leon@kernel.org \
--cc=ljs@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=rppt@kernel.org \
--cc=stable@vger.kernel.org \
/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