Commit a9c930ba authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix units in mbind check

maxnode is a bit index and can't be directly compared against a byte length
like PAGE_SIZE
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c255d844
...@@ -808,7 +808,7 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask, ...@@ -808,7 +808,7 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask,
nodes_clear(*nodes); nodes_clear(*nodes);
if (maxnode == 0 || !nmask) if (maxnode == 0 || !nmask)
return 0; return 0;
if (maxnode > PAGE_SIZE) if (maxnode > PAGE_SIZE*BITS_PER_BYTE)
return -EINVAL; return -EINVAL;
nlongs = BITS_TO_LONGS(maxnode); nlongs = BITS_TO_LONGS(maxnode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment