diff options
author | Petr Holasek <pholasek@redhat.com> | 2011-03-23 16:43:09 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 19:46:51 -0700 |
commit | cb16e95fa2996743a6e80a665ed2ed0590bd38cf (patch) | |
tree | 7128a7d03a94a68dd9550f33ac66876bf6854ad0 /fs | |
parent | 256c53a65128cbc8a766b1503f3f25a52a8d07cb (diff) | |
download | op-kernel-dev-cb16e95fa2996743a6e80a665ed2ed0590bd38cf.zip op-kernel-dev-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')
-rw-r--r-- | fs/drop_caches.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 2195c21..816f88e 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); |