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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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);