Date: Wed, 5 Mar 2008 18:16:45 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 136936 for review Message-ID: <200803051816.m25IGjeX081955@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=136936 Change 136936 by rdivacky@rdivacky_witten on 2008/03/05 18:16:33 Check for sane maxevents parameter. Noticed by: netchild Affected files ... .. //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.c#11 edit .. //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.h#5 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.c#11 (text+ko) ==== @@ -29,6 +29,7 @@ #include "opt_compat.h" +#include <sys/limits.h> #include <sys/param.h> #include <sys/types.h> #include <sys/systm.h> @@ -228,6 +229,9 @@ linux_kev_copyin}; int error; + if (args->maxevents <= 0 || args->maxevents > LINUX_MAX_EVENTS) + return (EINVAL); + /* Convert from miliseconds to timespec. */ ts.tv_sec = args->timeout / 1000000; ts.tv_nsec = (args->timeout % 1000000) * 1000; ==== //depot/projects/soc2007/rdivacky/linux_epoll/sys/compat/linux/linux_epoll.h#5 (text+ko) ==== @@ -50,4 +50,6 @@ #define LINUX_EPOLL_CTL_DEL 2 #define LINUX_EPOLL_CTL_MOD 3 +#define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct linux_epoll_event)) + #endif /* !_LINUX_EPOLL_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803051816.m25IGjeX081955>