svn commit: r277293 - user/dchagin/lemul/sys/compat/linux
Dmitry Chagin
dchagin at FreeBSD.org
Sat Jan 17 08:24:41 UTC 2015
Author: dchagin
Date: Sat Jan 17 08:24:40 2015
New Revision: 277293
URL: https://svnweb.freebsd.org/changeset/base/277293
Log:
Check that user supplied epfd file descriptor is a kqueue file descriptor
a bit earlier as in epoll_to_kevent() we use epoll.
Reported by: trinity
Modified:
user/dchagin/lemul/sys/compat/linux/linux_event.c
Modified: user/dchagin/lemul/sys/compat/linux/linux_event.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_event.c Sat Jan 17 08:14:46 2015 (r277292)
+++ user/dchagin/lemul/sys/compat/linux/linux_event.c Sat Jan 17 08:24:40 2015 (r277293)
@@ -402,6 +402,8 @@ linux_epoll_ctl(struct thread *td, struc
cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &epfp);
if (error != 0)
return (error);
+ if (epfp->f_type != DTYPE_KQUEUE)
+ goto leave1;
/* Protect user data vector from incorrectly supplied fd. */
error = fget(td, args->fd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp);
More information about the svn-src-user
mailing list