[PATCH 08/60] mm/migrate: reject move_pages() destinations outside common memory
From: Gregory Price via B4 Relay
Date: Fri Nov 20 2026 - 13:10:58 EST
From: "Gregory Price (Meta)" <gourry@xxxxxxxxxx>
move_pages(2) places user memory on a node the caller picks. As with
memory policies, the destination should be general purpose memory.
Reject a destination outside N_MEMORY_COMMON with -ENODEV, exactly
the same as a node without memory is rejected today.
Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
mm/migrate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index 65869b8acec5..208788b130fa 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2411,7 +2411,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,
err = -ENODEV;
if (node < 0 || node >= MAX_NUMNODES)
goto out_flush;
- if (!node_state(node, N_MEMORY))
+ if (!node_state(node, N_MEMORY_COMMON))
goto out_flush;
err = -EACCES;
--
2.56.1