aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/capability.h1
-rw-r--r--mm/vmscan.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 8d139f4acf23..6b4618902d3d 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t;
233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending 233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
234 arbitrary SCSI commands */ 234 arbitrary SCSI commands */
235/* Allow setting encryption key on loopback filesystem */ 235/* Allow setting encryption key on loopback filesystem */
236/* Allow setting zone reclaim policy */
236 237
237#define CAP_SYS_ADMIN 21 238#define CAP_SYS_ADMIN 21
238 239
diff --git a/mm/vmscan.c b/mm/vmscan.c
index cfffe5098d53..ab631a3c62c3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1375,6 +1375,9 @@ asmlinkage long sys_set_zone_reclaim(unsigned int node, unsigned int zone,
1375 struct zone *z; 1375 struct zone *z;
1376 int i; 1376 int i;
1377 1377
1378 if (!capable(CAP_SYS_ADMIN))
1379 return -EACCES;
1380
1378 if (node >= MAX_NUMNODES || !node_online(node)) 1381 if (node >= MAX_NUMNODES || !node_online(node))
1379 return -EINVAL; 1382 return -EINVAL;
1380 1383