mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Return EINVAL when an invalid file descriptor is specified.
MFC after: 1 month
This commit is contained in:
parent
92e10562d4
commit
e0a254f6df
1 changed files with 7 additions and 1 deletions
|
|
@ -462,8 +462,10 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args)
|
|||
cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &epfp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (epfp->f_type != DTYPE_KQUEUE)
|
||||
if (epfp->f_type != DTYPE_KQUEUE) {
|
||||
error = EINVAL;
|
||||
goto leave1;
|
||||
}
|
||||
|
||||
/* Protect user data vector from incorrectly supplied fd. */
|
||||
error = fget(td, args->fd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp);
|
||||
|
|
@ -560,6 +562,10 @@ linux_epoll_wait_common(struct thread *td, int epfd, struct epoll_event *events,
|
|||
cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (epfp->f_type != DTYPE_KQUEUE) {
|
||||
error = EINVAL;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
coargs.leventlist = events;
|
||||
coargs.p = td->td_proc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue