Re: [PATCH] mm/hmm: reject shadow-stack mappings

From: Jason Gunthorpe

Date: Sat Nov 14 2026 - 19:00:21 EST


On Fri, Nov 13, 2026 at 06:10:25PM -0800, Andrew Morton wrote:

> How does this look for an altered changelog?
>
> : 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.

Yes, but it is not just nouveau, RDMA user can do this too and
that is far more common..

Thanks,
Jason