summaryrefslogtreecommitdiffstats
path: root/block/ioprio.c
diff options
context:
space:
mode:
authorKhazhismel Kumykov <khazhy@google.com>2020-08-24 15:10:34 -0700
committerJens Axboe <axboe@kernel.dk>2020-09-01 19:38:33 -0600
commit9d3a39a5f1e45827b008fff1ee9cf3cac3409665 (patch)
treeefd4c6697c6ce2e649d724d43bca8b4c9d93ce94 /block/ioprio.c
parenta7863b3423fd5d1ab82161654ba83973764b570b (diff)
downloadlinux-stable-9d3a39a5f1e45827b008fff1ee9cf3cac3409665.tar.gz
linux-stable-9d3a39a5f1e45827b008fff1ee9cf3cac3409665.tar.bz2
linux-stable-9d3a39a5f1e45827b008fff1ee9cf3cac3409665.zip
block: grant IOPRIO_CLASS_RT to CAP_SYS_NICE
CAP_SYS_ADMIN is too broad, and ionice fits into CAP_SYS_NICE's grouping. Retain CAP_SYS_ADMIN permission for backwards compatibility. Signed-off-by: Khazhismel Kumykov <khazhy@google.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/ioprio.c')
-rw-r--r--block/ioprio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/ioprio.c b/block/ioprio.c
index 04ebd37966f1..364d2294ba90 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -69,7 +69,7 @@ int ioprio_check_cap(int ioprio)
switch (class) {
case IOPRIO_CLASS_RT:
- if (!capable(CAP_SYS_ADMIN))
+ if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
return -EPERM;
fallthrough;
/* rt has prio field too */