Re: [PATCH] mm/hmm: reject shadow-stack mappings
From: Gregory Price (Meta)
Date: Fri Nov 13 2026 - 15:38:29 EST
On 2026-11-13 19:57 +0000, Lorenzo Stoakes (ARM) wrote:
> On Fri, Nov 13, 2026 at 02:55:36PM -0500, Gregory Price (Meta) wrote:
> > HMM can grant ordinary device write access to a userspace shadow stack.
> > On x86, pte_write() is true for a shadow-stack PTE, so a populated page
> > can be returned with HMM_PFN_WRITE without taking a CPU write fault.
> >
> > Nouveau translates that flag into a writable GPU mapping.
> >
> > Reject shadow-stack VMAs in hmm_vma_walk_test(). Use the existing
> > unsupported-range handling: a requested fault returns -EFAULT, while a
> > snapshot records HMM_PFN_ERROR.
> >
> > Link: https://lore.kernel.org/linux-mm/20261111-mason-migrate-et-al-fixes-v1-10-3d2454362e8d@xxxxxxxxxx/
> > Fixes: 54007f818206 ("mm: Introduce VM_SHADOW_STACK for shadow stack memory")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Cc: "Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx>
> > Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
>
> Thanks for doing the HMM side of this, LGTM and:
>
Fell out of my testing harness when reviewing yours :]
Stuff like this is becoming much lower effort than yesteryear.
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
thanks!
--
~Gregory