Bug 787242 - Unexpected failure (permission denied) on attempt to change scheduling class to SCHED_FIFO.
Unexpected failure (permission denied) on attempt to change scheduling class ...
Product: Fedora
Classification: Fedora
Component: tigervnc (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Adam Tkac
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-02-03 11:41 EST by Vadim
Modified: 2013-04-30 19:51 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-07 10:54:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reproducer (963 bytes, text/plain)
2012-02-03 11:41 EST, Vadim
no flags Details

  None (edit)
Description Vadim 2012-02-03 11:41:40 EST
Created attachment 559323 [details]

Description of problem:

A program attempts to change its scheduling class to SCHED_FIFO. Program has CAP_SYS_NICE privilege.

Success when user logged in locally.
Failure (EPERM) when user logged in using VNC.

Version-Release number of selected component (if applicable):

Linux ... #1 SMP Wed Jul 6 13:58:54 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


How reproducible:

Build and run a test program.

Steps to Reproduce:

1. Compile the program:

#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/capability.h>
#include <sched.h>

int main() {

   cap_t caps = cap_get_proc();
   if (caps == NULL) {


   } else {

       ssize_t s = 0;
       char * p = cap_to_text(caps, &s);

       if (p == NULL) {


       } else {

           printf("cap_to_text()" ": %s\n", p);

           p = 0;
       s = 0;

       caps = NULL;

   struct sched_param sched;
   sched.sched_priority = sched_get_priority_min(SCHED_FIFO);

   if (sched_setscheduler(0, SCHED_FIFO, &sched) < 0) {


   } else if (sched.sched_priority = 0, sched_setscheduler(0, SCHED_OTHER, &sched) < 0) {


   } else {

   return errno;

$ cc -lcap ...

2. Grant CAP_SYS_NICE to the resulting ./a.out.

3. Run ./a.out
Actual results (login via VNC):

[model@amdx2 ~]$ getcap ./a.out
./a.out = cap_sys_nice+ep
[model@amdx2 ~]$ ./a.out
cap_to_text(): = cap_sys_nice+ep
sched_setscheduler(SCHED_FIFO): Operation not permitted

Expected results (login locally):

[model@amdx2 ~]$ getcap ./a.out
./a.out = cap_sys_nice+ep
[model@amdx2 ~]$ ./a.out
cap_to_text(): = cap_sys_nice+ep

Additional info:

Program source is attached.
Comment 1 Fedora End Of Life 2012-08-07 10:54:57 EDT
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:

Note You need to log in before you can comment on or make changes to this bug.