summaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-11-19 17:34:25 -0800
committerRoland McGrath <roland@hack.frob.com>2014-11-19 17:34:25 -0800
commitd960211ff52a6ab632eace2f905c4898f187df9e (patch)
treef989f556029bd7c3a6fad8fc5461aeb11c516e58 /nptl/pthread_create.c
parentcbd463e2cfc94d8cf74d17f17a9c572c272b9376 (diff)
NPTL: Don't (re)validate sched_priority in pthread_create.
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index da3dc4603f..1dd1b951c0 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -605,6 +605,7 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
}
if (iattr->flags & ATTR_FLAG_SCHED_SET)
+ /* The values were validated in pthread_attr_setschedparam. */
memcpy (&pd->schedparam, &iattr->schedparam,
sizeof (struct sched_param));
else if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0)
@@ -612,26 +613,6 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
INTERNAL_SYSCALL (sched_getparam, scerr, 2, 0, &pd->schedparam);
pd->flags |= ATTR_FLAG_SCHED_SET;
}
-
- /* Check for valid priorities. */
- int minprio = INTERNAL_SYSCALL (sched_get_priority_min, scerr, 1,
- iattr->schedpolicy);
- int maxprio = INTERNAL_SYSCALL (sched_get_priority_max, scerr, 1,
- iattr->schedpolicy);
- if (pd->schedparam.sched_priority < minprio
- || pd->schedparam.sched_priority > maxprio)
- {
- /* Perhaps a thread wants to change the IDs and if waiting
- for this stillborn thread. */
- if (__builtin_expect (atomic_exchange_acq (&pd->setxid_futex, 0)
- == -2, 0))
- lll_futex_wake (&pd->setxid_futex, 1, LLL_PRIVATE);
-
- __deallocate_stack (pd);
-
- retval = EINVAL;
- goto out;
- }
}
/* Pass the descriptor to the caller. */