]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ioprio.c
[PATCH] move capable() to capability.h
[mirror_ubuntu-bionic-kernel.git] / fs / ioprio.c
index 97e1f088ba00b3b63f7f9ea594b756781fcf6596..4bf1c6365a19d2ce3d9ae52da457026792528f40 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/ioprio.h>
 #include <linux/blkdev.h>
+#include <linux/syscalls.h>
 
 static int set_task_ioprio(struct task_struct *task, int ioprio)
 {
@@ -62,6 +63,8 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
 
                        break;
                case IOPRIO_CLASS_IDLE:
+                       if (!capable(CAP_SYS_ADMIN))
+                               return -EPERM;
                        break;
                default:
                        return -EINVAL;