aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-08-31 03:12:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-31 04:42:23 -0400
commit3b42d28b2a04b3c9830eb865288239d45eccc402 (patch)
tree776a297ef8bd8a879da74290543907014abe6198
parentdec4ad86c2fbea062e9ef9caa6d6e79f7c5e0b12 (diff)
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 <clameter@sgi.com> Cc: Shaohua Li <shaohua.li@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/mempolicy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 172abffeb2e3..bb54b88c3d5a 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -955,6 +955,11 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
955 goto out; 955 goto out;
956 } 956 }
957 957
958 if (!nodes_subset(new, node_online_map)) {
959 err = -EINVAL;
960 goto out;
961 }
962
958 err = security_task_movememory(task); 963 err = security_task_movememory(task);
959 if (err) 964 if (err)
960 goto out; 965 goto out;