[PATCH] get_nodes should ignore invalid node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



get_nodes doesn't check if nodes in node mask are valid, cause a kernel
oops when an invalid node is used..

Signed-off-by: Shaohua Li <[email protected]>

Index: linux/mm/mempolicy.c
===================================================================
--- linux.orig/mm/mempolicy.c	2007-07-25 09:14:33.000000000 +0800
+++ linux/mm/mempolicy.c	2007-08-21 13:15:41.000000000 +0800
@@ -850,6 +850,8 @@ static int get_nodes(nodemask_t *nodes, 
 	if (copy_from_user(nodes_addr(*nodes), nmask, nlongs*sizeof(unsigned long)))
 		return -EFAULT;
 	nodes_addr(*nodes)[nlongs-1] &= endmask;
+
+	nodes_and(*nodes, *nodes, node_online_map);
 	return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux