X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/593a1d5fd87cdf5b46dd5fcb84467b432cea0f91..c910b4d9d2451126ae3917b931cd4390c11e1d52:/bsd/kern/pthread_synch.c diff --git a/bsd/kern/pthread_synch.c b/bsd/kern/pthread_synch.c index 4ccfd04fc..be4e9c165 100644 --- a/bsd/kern/pthread_synch.c +++ b/bsd/kern/pthread_synch.c @@ -1556,6 +1556,9 @@ workq_ops(struct proc *p, struct workq_ops_args *uap, __unused register_t *retv KERNEL_DEBUG(0xefffd008 | DBG_FUNC_NONE, (int)item, 0, 0, 0, 0); + if ((prio < 0) || (prio >= 5)) + return (EINVAL); + workqueue_lock_spin(p); if ((wq = (struct workqueue *)p->p_wqptr) == NULL) { @@ -1568,6 +1571,9 @@ workq_ops(struct proc *p, struct workq_ops_args *uap, __unused register_t *retv break; case WQOPS_QUEUE_REMOVE: { + if ((prio < 0) || (prio >= 5)) + return (EINVAL); + workqueue_lock_spin(p); if ((wq = (struct workqueue *)p->p_wqptr) == NULL) {