projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d888a4c
)
timers: Fix timer_migration interface which accepts any number as input
author
Arun R Bharadwaj
<
[email protected]
>
Tue, 23 Jun 2009 04:30:58 +0000
(10:00 +0530)
committer
Ingo Molnar
<
[email protected]
>
Tue, 23 Jun 2009 08:49:33 +0000
(10:49 +0200)
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 <
[email protected]
>
Tested-by: Poornima Nayak <
[email protected]
>
Signed-off-by: Arun R Bharadwaj <
[email protected]
>
Cc: poornima nayak <
[email protected]
>
Cc: Arun Bharadwaj <
[email protected]
>
LKML-Reference: <
20090623043058
[email protected]
>
Signed-off-by: Ingo Molnar <
[email protected]
>
kernel/sysctl.c
patch
|
blob
|
history
diff --git
a/kernel/sysctl.c
b/kernel/sysctl.c
index 62e4ff9968b5fe64a06c9f8735af10d3b6a304b9..c428ba161db1e4908b110870eb157f673977c4bc 100644
(file)
--- a/
kernel/sysctl.c
+++ b/
kernel/sysctl.c
@@
-335,7
+335,10
@@
static struct ctl_table kern_table[] = {
.data = &sysctl_timer_migration,
.maxlen = sizeof(unsigned int),
.mode = 0644,
- .proc_handler = &proc_dointvec,
+ .proc_handler = &proc_dointvec_minmax,
+ .strategy = &sysctl_intvec,
+ .extra1 = &zero,
+ .extra2 = &one,
},
#endif
{