block: grant IOPRIO_CLASS_RT to CAP_SYS_NICE
Subsystems (4)
PATCH v2 1/1 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.
--- block/ioprio.c | 2 +- include/uapi/linux/capability.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
v2: fix embarrassing logic mistake
block/ioprio.c +1 -1
@@ -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 ;/* fall through */ /* rt has prio field too */
include/uapi/linux/capability.h +2 -0
@@ -288,6 +288,8 @@ struct vfs_ns_cap_data {processes and setting the scheduling algorithm used by another process. */ /* Allow setting cpu affinity on other processes */ +/* Allow setting realtime ioprio class */ +/* Allow setting ioprio class on other processes */ #define CAP_SYS_NICE 23
Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
Quoted 5 lines · Khazhismel Kumykov
CAP_SYS_ADMINis too broad, and ionice fits into CAP_SYS_NICE's grouping.Retain
CAP_SYS_ADMINpermission for backwards compatibility.Signed-off-by Khazhismel Kumykov <[email protected]>
Quoted 34 lines
--- block/ioprio.c | 2 +- include/uapi/linux/capability.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)v2: fix embarrassing logic mistake
block/ioprio.c +1
-1@@ -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 ;/* fall through */ /* rt has prio field too */ include/uapi/linux/capability.h +2
-0@@ -288,6 +288,8 @@ struct vfs_ns_cap_data {processes and setting the scheduling algorithm used by another process. */ /* Allow setting cpu affinity on other processes */ +/* Allow setting realtime ioprio class */ +/* Allow setting ioprio class on other processes */ #define CAP_SYS_NICE 23Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
Quoted 29 lines · Khazhismel Kumykov
CAP_SYS_ADMINis too broad, and ionice fits into CAP_SYS_NICE's grouping.Retain
CAP_SYS_ADMINpermission for backwards compatibility.Signed-off-by Khazhismel Kumykov <[email protected]>--- block/ioprio.c | 2 +- include/uapi/linux/capability.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)v2: fix embarrassing logic mistake
block/ioprio.c +1
-1@@ -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 ;/* fall through */ /* rt has prio field too */ include/uapi/linux/capability.h +0
-0
include/uapi/linux/capability.h struct vfs_ns_cap_data { · line 294
Quoted 7 lines
include/uapi/linux/capability.h +2
-0@@ -288,6 +288,8 @@ struct vfs_ns_cap_data {processes and setting the scheduling algorithm used by another process. */ /* Allow setting cpu affinity on other processes */ +/* Allow setting realtime ioprio class */ +/* Allow setting ioprio class on other processes */ #define CAP_SYS_NICE 23
From https://www.kernel.org/doc/man-pages/linux-api-ml.html:
"all Linux kernel patches that change userspace interfaces should be CCed to [email protected]"
So I have added the linux-api mailing list to the Cc-list. Anyway:
Quoted 6 lines · Bart Van Assche
From https://www.kernel.org/doc/man-pages/linux-api-ml.html:
"all Linux kernel patches that change userspace interfaces should be CCed to [email protected]"So I have added the linux-api mailing list to the Cc-list. Anyway:
Thanks, sorry for missing that!
Quoted 2 lines
Reviewed-by Bart Van Assche <[email protected]>
Jens, does this change look good?
khazhy
Jens Axboe
maintainerQuoted 6 lines · Khazhismel Kumykov
Quoted 5 lines · Bart Van Assche
From https://www.kernel.org/doc/man-pages/linux-api-ml.html:
"all Linux kernel patches that change userspace interfaces should be CCed to [email protected]"
Quoted 6 lines
Quoted 1 line
So I have added the linux-api mailing list to the Cc-list. Anyway:
Thanks, sorry for missing that!
Quoted 2 lines
Reviewed-by Bart Van Assche <[email protected]>Jens, does this change look good?
Yes, I'll queue it up for 5.10.
Signature · 1 line
Jens Axboe