From f8b92ec1f56df6a25e18bf05f1cdfa1c252e56dc Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Sat, 3 Sep 2005 15:54:50 -0700 Subject: [PATCH] --- yaml --- r: 6865 b: refs/heads/master c: bce5f6ba340b09d8b29902add204bb95a6d3d88b h: refs/heads/master i: 6863: 08505f39af1322429b7abe95dcbd8411c1d9ca29 v: v3 --- [refs] | 2 +- trunk/include/linux/capability.h | 1 + trunk/mm/vmscan.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f0fba36f6693..909603cd1ed0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 242e54686257493f0b10ac557e730419d9af7d24 +refs/heads/master: bce5f6ba340b09d8b29902add204bb95a6d3d88b diff --git a/trunk/include/linux/capability.h b/trunk/include/linux/capability.h index 8d139f4acf23..6b4618902d3d 100644 --- a/trunk/include/linux/capability.h +++ b/trunk/include/linux/capability.h @@ -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 diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index cfffe5098d53..ab631a3c62c3 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -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;