aboutsummaryrefslogtreecommitdiff
path: root/fs/drop_caches.c
diff options
context:
space:
mode:
authorPetr Holasek <pholasek@redhat.com>2011-03-23 16:43:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 19:46:51 -0700
commitcb16e95fa2996743a6e80a665ed2ed0590bd38cf (patch)
tree7128a7d03a94a68dd9550f33ac66876bf6854ad0 /fs/drop_caches.c
parent256c53a65128cbc8a766b1503f3f25a52a8d07cb (diff)
downloadlinux-cb16e95fa2996743a6e80a665ed2ed0590bd38cf.tar.gz
sysctl: add some missing input constraint checks
Add boundaries of allowed input ranges for: dirty_expire_centisecs, drop_caches, overcommit_memory, page-cluster and panic_on_oom. Signed-off-by: Petr Holasek <pholasek@redhat.com> Acked-by: Dave Young <hidave.darkstar@gmail.com> Cc: David Rientjes <rientjes@google.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/drop_caches.c')
-rw-r--r--fs/drop_caches.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index 2195c213ab2..816f88e6b9c 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -45,7 +45,11 @@ static void drop_slab(void)
int drop_caches_sysctl_handler(ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
- proc_dointvec_minmax(table, write, buffer, length, ppos);
+ int ret;
+
+ ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
+ if (ret)
+ return ret;
if (write) {
if (sysctl_drop_caches & 1)
iterate_supers(drop_pagecache_sb, NULL);