aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorArun R Bharadwaj <arun@linux.vnet.ibm.com>2009-06-23 00:30:58 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-23 04:49:33 -0400
commitbfdb4d9f0f611687d71cf6a460efc9e755f4a462 (patch)
treed5a2ef0ccaa4da93ccb4275d8da80221788b2e48 /kernel
parentd888a4c76c51092993643f8992bf55b3c28da483 (diff)
timers: Fix timer_migration interface which accepts any number as input
Poornima Nayek reported: | Timer migration interface /proc/sys/kernel/timer_migration in | 2.6.30-git9 accepts any numerical value as input. | | Steps to reproduce: | 1. echo -6666666 > /proc/sys/kernel/timer_migration | 2. cat /proc/sys/kernel/timer_migration | -6666666 | | 1. echo 44444444444444444444444444444444444444444444444444444444444 > /proc/sys/kernel/timer_migration | 2. cat /proc/sys/kernel/timer_migration | -1357789412 | | Expected behavior: Should 'echo: write error: Invalid argument' while | setting any value other then 0 & 1 Restrict valid values to 0 and 1. Reported-by: Poornima Nayak <mpnayak@linux.vnet.ibm.com> Tested-by: Poornima Nayak <mpnayak@linux.vnet.ibm.com> Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com> Cc: poornima nayak <mpnayak@linux.vnet.ibm.com> Cc: Arun Bharadwaj <arun@linux.vnet.ibm.com> LKML-Reference: <20090623043058.GA3249@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 62e4ff9968b5..c428ba161db1 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -335,7 +335,10 @@ static struct ctl_table kern_table[] = {
335 .data = &sysctl_timer_migration, 335 .data = &sysctl_timer_migration,
336 .maxlen = sizeof(unsigned int), 336 .maxlen = sizeof(unsigned int),
337 .mode = 0644, 337 .mode = 0644,
338 .proc_handler = &proc_dointvec, 338 .proc_handler = &proc_dointvec_minmax,
339 .strategy = &sysctl_intvec,
340 .extra1 = &zero,
341 .extra2 = &one,
339 }, 342 },
340#endif 343#endif
341 { 344 {