Skip to content

Commit

Permalink
Page migration: Do not accept invalid nodes in the target nodeset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Aug 31, 2007
1 parent dec4ad8 commit 3b42d28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3b42d28

Please sign in to comment.