kernel-hacking-2024-linux-s.../kernel
Andreas Steinmetz 18586e7216 [PATCH] Fix RLIMIT_RTPRIO breakage
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.

Signed-off-by: Andreas Steinmetz <ast@domdv.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-26 15:30:51 -07:00
..
irq [PATCH] irqpoll 2005-06-28 21:20:35 -07:00
power [PATCH] swpsuspend: Have suspend to disk use factors of sys_reboot 2005-07-26 14:35:44 -07:00
acct.c
audit.c
auditsc.c
capability.c
compat.c
configs.c
cpu.c
cpuset.c [PATCH] Dynamic sched domains: cpuset changes 2005-06-25 16:24:45 -07:00
crash_dump.c [PATCH] kdump: Access dump file in elf format (/proc/vmcore) 2005-06-25 16:24:53 -07:00
dma.c
exec_domain.c
exit.c [PATCH] Update cfq io scheduler to time sliced design 2005-06-27 14:33:29 -07:00
extable.c
fork.c [PATCH] lower VM_DONTCOPY total_vm 2005-07-12 16:00:58 -07:00
futex.c
intermodule.c
itimer.c [PATCH] ITIMER_REAL: fix possible deadlock and race 2005-06-28 21:20:30 -07:00
kallsyms.c
Kconfig.hz
Kconfig.preempt [PATCH] sched: voluntary kernel preemption 2005-06-25 16:24:45 -07:00
kexec.c [PATCH] kexec: fix sparse warnings 2005-06-28 14:53:40 -07:00
kfifo.c
kmod.c
kprobes.c [PATCH] kprobes: fix namespace problem and sparc64 build 2005-07-05 19:19:00 -07:00
ksysfs.c [PATCH] Kdump: Export crash notes section address through sysfs 2005-06-25 16:24:51 -07:00
kthread.c
Makefile [PATCH] kdump: Routines for copying dump pages 2005-06-25 16:24:53 -07:00
module.c
panic.c [PATCH] Call emergency_reboot from panic 2005-07-26 14:35:43 -07:00
params.c
pid.c
posix-cpu-timers.c
posix-timers.c
printk.c [PATCH] CPU hotplug printk fix 2005-06-25 16:24:34 -07:00
profile.c [PATCH] mostly_read data section 2005-07-07 18:23:46 -07:00
ptrace.c
rcupdate.c
resource.c [PATCH] Use ALIGN to remove duplicate code 2005-06-25 16:25:02 -07:00
sched.c [PATCH] Fix RLIMIT_RTPRIO breakage 2005-07-26 15:30:51 -07:00
seccomp.c
signal.c [PATCH] Cleanup patch for process freezing 2005-06-25 17:10:13 -07:00
softirq.c
spinlock.c
stop_machine.c
sys.c [PATCH] Add emergency_restart() 2005-07-26 14:35:41 -07:00
sys_ni.c [PATCH] inotify 2005-07-12 20:38:38 -07:00
sysctl.c [PATCH] inotify: move sysctl 2005-07-13 11:09:31 -07:00
time.c
timer.c [PATCH] kernel/timer: fix msleep_interruptible() comment 2005-06-25 16:24:58 -07:00
uid16.c
user.c [PATCH] inotify 2005-07-12 20:38:38 -07:00
wait.c
workqueue.c