瀏覽代碼

Don't allow normal users to set idle IO priority

It has all the normal priority inversion problems.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds 20 年之前
父節點
當前提交
f6fdd7d9c2
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/ioprio.c

+ 2 - 0
fs/ioprio.c

@@ -62,6 +62,8 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
 
 
 			break;
 			break;
 		case IOPRIO_CLASS_IDLE:
 		case IOPRIO_CLASS_IDLE:
+			if (!capable(CAP_SYS_ADMIN))
+				return -EPERM;
 			break;
 			break;
 		default:
 		default:
 			return -EINVAL;
 			return -EINVAL;