• Ingo Molnar's avatar
    [PATCH] sys_setpriority() euid semantics fix · 410a5816
    Ingo Molnar authored
    What _is_ inconsistent is kernel/sys.c's setpriority()/set_one_prio().
    
    It checks current->euid|uid against p->uid, which makes little sense, but
    is how we've been doing it ever since.  It's a Linux quirk documented in
    the manpage.  To make things funnier, SuS requires current->euid|uid match
    against p->euid.
    
    The patch below fixes it (and brings the logic in line with what
    setscheduler()/setaffinity() does), but if we do it then it should be done
    only in 2.6.12 or later, after good exposure in -mm.
    
    (Worst-case this could break an application but i highly doubt it: it at
    most could deny renicing another task to positive (or in very rare cases,
    to negative) nice values, which no application should crash on something
    like that, normally.)
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    410a5816
sys.c 39.3 KB