sched_setscheduler allows a process with CAP_SYS_NICE to set
real-time policy. Let ioprio_set follow this.

Signed-off-by: Kusanagi Kouichi <sl...@ac.auone-net.jp>
---
 fs/ioprio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ioprio.c b/fs/ioprio.c
index e50170c..155b51e 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -70,7 +70,7 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
 
        switch (class) {
                case IOPRIO_CLASS_RT:
-                       if (!capable(CAP_SYS_ADMIN))
+                       if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
                                return -EPERM;
                        /* fall through, rt has prio field too */
                case IOPRIO_CLASS_BE:
-- 
1.7.10.4

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

Reply via email to