From 3b42d28b2a04b3c9830eb865288239d45eccc402 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 31 Aug 2007 00:12:08 -0700 Subject: [PATCH] Page migration: Do not accept invalid nodes in the target nodeset Page migration currently does not check if the target of the move contains nodes that that are invalid (if root attempts to migrate pages) and may try to allocate from invalid nodes if these are specified leading to oopses. Return -EINVAL if an offline node is specified. Signed-off-by: Christoph Lameter Cc: Shaohua Li Cc: Andrew Morton Signed-off-by: Linus Torvalds --- mm/mempolicy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 172abffeb2..bb54b88c3d 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -955,6 +955,11 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, goto out; } + if (!nodes_subset(new, node_online_map)) { + err = -EINVAL; + goto out; + } + err = security_task_movememory(task); if (err) goto out; -- 2.39.5