All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andreas Steinmetz <ast@domdv.de>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.6.13rc3: RLIMIT_RTPRIO broken
Date: Tue, 26 Jul 2005 12:26:38 +0200	[thread overview]
Message-ID: <20050726102638.GA4000@elte.hu> (raw)
In-Reply-To: <42E22D0C.1010608@domdv.de>


* 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

  parent reply	other threads:[~2005-07-26 10:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-23 11:42 [PATCH] 2.6.13rc3: RLIMIT_RTPRIO broken Andreas Steinmetz
2005-07-23 17:09 ` Lee Revell
2005-07-23 17:26   ` Andreas Steinmetz
2005-07-26 10:26 ` Ingo Molnar [this message]
2005-07-26 11:56   ` Paolo Ciarrocchi
2005-07-26 12:06     ` Ingo Molnar
2005-07-26 14:34       ` Lee Revell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050726102638.GA4000@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=ast@domdv.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.