提交 bce5f6ba 编写于 作者: M Martin Hicks 提交者: Linus Torvalds

[PATCH] VM: add capabilites check to set_zone_reclaim

Add a capability check to sys_set_zone_reclaim().  This syscall is not
something that should be available to a user.
Signed-off-by: NMartin Hicks <mort@sgi.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 242e5468
......@@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t;
/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
arbitrary SCSI commands */
/* Allow setting encryption key on loopback filesystem */
/* Allow setting zone reclaim policy */
#define CAP_SYS_ADMIN 21
......
......@@ -1375,6 +1375,9 @@ asmlinkage long sys_set_zone_reclaim(unsigned int node, unsigned int zone,
struct zone *z;
int i;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (node >= MAX_NUMNODES || !node_online(node))
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册