Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -808,7 +808,7 @@ static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask,
	nodes_clear(*nodes);
	if (maxnode == 0 || !nmask)
		return 0;
	if (maxnode > PAGE_SIZE)
	if (maxnode > PAGE_SIZE*BITS_PER_BYTE)
		return -EINVAL;

	nlongs = BITS_TO_LONGS(maxnode);