Commit 636f13c1 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] sys_mbind sanity checking

Make sure maxnodes is safe size before calculating nlongs in
Signed-off-by: default avatarChris Wright <>
Signed-off-by: default avatarLinus Torvalds <>
parent 74910e6c
......@@ -808,6 +808,8 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask,
if (maxnode == 0 || !nmask)
return 0;
if (maxnode > PAGE_SIZE)
return -EINVAL;
nlongs = BITS_TO_LONGS(maxnode);
if ((maxnode % BITS_PER_LONG) == 0)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment