Bug 2796 - pthread_mutexattr_getprioceiling() returns prioceiling out of range
Summary: pthread_mutexattr_getprioceiling() returns prioceiling out of range
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-18 23:47 UTC by Petr Baudis
Modified: 2014-07-04 16:37 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Proposed patch (501 bytes, patch)
2006-06-19 01:24 UTC, Petr Baudis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Baudis 2006-06-18 23:47:09 UTC
As specified in
http://www.opengroup.org/onlinepubs/000095399/functions/pthread_mutexattr_getprioceiling.html, the prioceiling value shall be in range defined by SCHED_FIFO, but
when calling it on a new mutexattr it is zero while the SCHED_FIFO range is
1..99.

The same applies to phtread_mutex_getprioceiling().

This also causes the LTP testsuite to fail.
Comment 1 Petr Baudis 2006-06-19 01:24:18 UTC
Created attachment 1100 [details]
Proposed patch

This patch makes the getprioceiling() functions check if the priority is high
enough and bump it to the minimal allowable priority if not. It is rather ugly
to do the sanitization at that point but the thing is that we default for 0
e.g. in the constant initializers so a pthread_mutexattr_init()-ish solution
isn't really viable. Perhaps we could cache the range, though.
Comment 2 Petr Baudis 2006-06-19 11:10:15 UTC
Adding Jakub Jelinek (the author of implementation of these calls) to Cc.
Comment 3 Petr Baudis 2006-07-12 00:26:50 UTC
So, any thoughts about this?
Comment 4 Ulrich Drepper 2006-08-13 19:38:19 UTC
Fix the test suite.  glibc explicitly announces that priority protection is not
supported.