]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/pthread_synch.c
xnu-1228.12.14.tar.gz
[apple/xnu.git] / bsd / kern / pthread_synch.c
index 4ccfd04fcb4389e2958505b0ed98d402eb514215..be4e9c165e8e2782dd739d2703f6e9c42941b728 100644 (file)
@@ -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) {