We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa55b7d commit 94c4b4fCopy full SHA for 94c4b4f
block/ioprio.c
@@ -69,7 +69,14 @@ int ioprio_check_cap(int ioprio)
69
70
switch (class) {
71
case IOPRIO_CLASS_RT:
72
- if (!capable(CAP_SYS_NICE) && !capable(CAP_SYS_ADMIN))
+ /*
73
+ * Originally this only checked for CAP_SYS_ADMIN,
74
+ * which was implicitly allowed for pid 0 by security
75
+ * modules such as SELinux. Make sure we check
76
+ * CAP_SYS_ADMIN first to avoid a denial/avc for
77
+ * possibly missing CAP_SYS_NICE permission.
78
+ */
79
+ if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_NICE))
80
return -EPERM;
81
fallthrough;
82
/* rt has prio field too */
0 commit comments