lkml.org 
[lkml]   [2005]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.6.13rc3: RLIMIT_RTPRIO broken

* Andreas Steinmetz <ast@domdv.de> wrote:

> RLIMIT_RTPRIO is supposed to grant non privileged users the right to
> use SCHED_FIFO/SCHED_RR scheduling policies with priorites bounded by
> the RLIMIT_RTPRIO value via sched_setscheduler(). This is usually used
> by audio users.
>
> Unfortunately this is broken in 2.6.13rc3 as you can see in the
> excerpt from sched_setscheduler below:
>
> /*
> * Allow unprivileged RT tasks to decrease priority:
> */
> if (!capable(CAP_SYS_NICE)) {
> /* can't change policy */
> if (policy != p->policy)
> return -EPERM;
>
> After the above unconditional test which causes sched_setscheduler to
> fail with no regard to the RLIMIT_RTPRIO value the following check is made:
>
> /* can't increase priority */
> if (policy != SCHED_NORMAL &&
> param->sched_priority > p->rt_priority &&
> param->sched_priority >
> p->signal->rlim[RLIMIT_RTPRIO].rlim_cur)
> return -EPERM;
>
> Thus I do believe that the RLIMIT_RTPRIO value must be taken into
> account for the policy check, especially as the RLIMIT_RTPRIO limit is
> of no use without this change.
>
> The attached patch fixes this problem. I would appreciate it if the
> fix would make it into 2.6.13.

[back from KS/OLS]

indeed. The effect of the bug is that RLIMIT_RTPRIO is completely
non-functional in 2.6.12.

Acked-by: Ingo Molnar <mingo@elte.hu>

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-26 12:30    [W:0.068 / U:1.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site