提交 9d3a39a5 编写于 作者: K Khazhismel Kumykov 提交者: Jens Axboe

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: NKhazhismel Kumykov <khazhy@google.com>
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Acked-by: NSerge Hallyn <serge@hallyn.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 a7863b34
...@@ -69,7 +69,7 @@ int ioprio_check_cap(int ioprio) ...@@ -69,7 +69,7 @@ int ioprio_check_cap(int ioprio)
switch (class) { switch (class) {
case IOPRIO_CLASS_RT: case IOPRIO_CLASS_RT:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
fallthrough; fallthrough;
/* rt has prio field too */ /* rt has prio field too */
......
...@@ -288,6 +288,8 @@ struct vfs_ns_cap_data { ...@@ -288,6 +288,8 @@ struct vfs_ns_cap_data {
processes and setting the scheduling algorithm used by another processes and setting the scheduling algorithm used by another
process. */ process. */
/* Allow setting cpu affinity on other processes */ /* Allow setting cpu affinity on other processes */
/* Allow setting realtime ioprio class */
/* Allow setting ioprio class on other processes */
#define CAP_SYS_NICE 23 #define CAP_SYS_NICE 23
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册