From: Christoph Lameter Date: Fri, 31 Aug 2007 07:12:08 +0000 (-0700) Subject: Page migration: Do not accept invalid nodes in the target nodeset X-Git-Tag: v2.6.23-rc5~9 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b42d28b2a04b3c9830eb865288239d45eccc402;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 172abffeb2e..bb54b88c3d5 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;