Commit 0d39f73b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] spoll_create size check

From: Davide Libenzi <davidel@xmailserver.org>

This is a sanity check on the size parameter.  Nothing explodes w/out, but
the conversion to unsigned simply triggers a big allocation.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent efa7ca06
......@@ -499,6 +499,11 @@ asmlinkage long sys_epoll_create(int size)
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n",
current, size));
/* Sanity check on the size parameter */
error = -EINVAL;
if (size <= 0)
goto eexit_1;
/* Correctly size the hash */
hashbits = ep_get_hash_bits((unsigned int) size);
......
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