Re: [PATCH v2 10/13] mm/migrate_device: refuse to migrate shadow stacks
From: David Hildenbrand (Arm)
Date: Wed Nov 18 2026 - 10:42:43 EST
On 11/13/26 22:45, Lorenzo Stoakes (ARM) wrote:
> From: Chris Mason <mason@xxxxxxxxxx>
>
> The kernel blocks ordinary writes to a shadow stack. But pte_write() is
> true for a shadow stack entry, and migrate_vma_setup() sets
> MIGRATE_PFN_WRITE for each page where pte_write() is true.
>
> Notably, the nouveau GPU driver takes that flag as permission to map its
> copy of the page writable for the GPU, meaning that the next CPU access
> migrates the page back into the shadow stack, and the page then holds what
> the GPU wrote.
>
> Be consistent and disallow this for migration.
>
> Fixes: 54007f818206 ("mm: Introduce VM_SHADOW_STACK for shadow stack memory")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Chris Mason <mason@xxxxxxxxxx>
> [ ljs: removed unnecessary comment, refined commit msg ]
> Reviewed-by: Alistair Popple <apopple@xxxxxxxxxx>
> Reviewed-by: Balbir Singh <balbirs@xxxxxxxxxx>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David