Commit 3b3376f
sysctl.c: fix underflow value setting risk in vm_table
Apart from subsystem specific .proc_handler handler, all ctl_tables with
extra1 and extra2 members set should use proc_dointvec_minmax instead of
proc_dointvec, or the limit set in extra* never work and potentially echo
underflow values(negative numbers) is likely make system unstable.
Especially vfs_cache_pressure and zone_reclaim_mode, -1 is apparently not
a valid value, but we can set to them. And then kernel may crash.
# echo -1 > /proc/sys/vm/vfs_cache_pressure
Link: https://lkml.kernel.org/r/20201223105535.2875-1-linf@wangsu.com
Signed-off-by: Lin Feng <linf@wangsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 4508943 commit 3b3376f
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2962 | 2962 | | |
2963 | 2963 | | |
2964 | 2964 | | |
2965 | | - | |
| 2965 | + | |
2966 | 2966 | | |
2967 | 2967 | | |
2968 | 2968 | | |
2969 | 2969 | | |
2970 | 2970 | | |
2971 | 2971 | | |
2972 | 2972 | | |
2973 | | - | |
| 2973 | + | |
2974 | 2974 | | |
2975 | 2975 | | |
2976 | 2976 | | |
| |||
2980 | 2980 | | |
2981 | 2981 | | |
2982 | 2982 | | |
2983 | | - | |
| 2983 | + | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | 2986 | | |
| |||
2990 | 2990 | | |
2991 | 2991 | | |
2992 | 2992 | | |
2993 | | - | |
| 2993 | + | |
2994 | 2994 | | |
2995 | 2995 | | |
2996 | 2996 | | |
| |||
0 commit comments