This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch roland/nptl created. glibc-2.20-202-g8814d6b


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, roland/nptl has been created
        at  8814d6b442899f6b552c4cf095aac1a553a1e1db (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8814d6b442899f6b552c4cf095aac1a553a1e1db

commit 8814d6b442899f6b552c4cf095aac1a553a1e1db
Author: Roland McGrath <roland@hack.frob.com>
Date:   Tue Nov 18 11:31:45 2014 -0800

    NPTL: Don't (re)validate sched_priority in pthread_create.

diff --git a/ChangeLog b/ChangeLog
index 37b1459..117090a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-11-18  Roland McGrath  <roland@hack.frob.com>
 
+	* nptl/pthread_create.c (__pthread_create_2_1): Don't try to validate
+	the sched_priority value here.  It was already checked when the user
+	called pthread_attr_setschedparam.
+
 	* nptl/createthread.c: New file.
 
 	* nptl/createthread.c: Moved ...
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index da3dc46..1dd1b95 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.  */

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]