Page migration: Do not accept invalid nodes as a target nodeset Page migration currently does not check if the target of the move contains nodes that that are invalid and may try to allocate from invalid nodes if these are specified leading to oopses. Return -EINVAL if a node is specified that is not known to have memory. Signed-off-by: Christoph Lameter --- mm/mempolicy.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6.23-rc3-mm1/mm/mempolicy.c =================================================================== --- linux-2.6.23-rc3-mm1.orig/mm/mempolicy.c 2007-08-23 12:26:49.000000000 -0700 +++ linux-2.6.23-rc3-mm1/mm/mempolicy.c 2007-08-23 14:44:50.000000000 -0700 @@ -965,6 +965,11 @@ asmlinkage long sys_migrate_pages(pid_t goto out; } + if (!nodes_subset(new, node_states[N_HIGH_MEMORY])) { + err = -EINVAL; + goto out; + } + err = security_task_movememory(task); if (err) goto out;