From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Wed, 5 Aug 2026 14:01:15 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] ve/mm: enforce the 0..100 bound on vfs_cache_min_ratio In-Reply-To: <20260706110002.1024515-5-khorenko@virtuozzo.com> Message-ID: <202608051201.675C1FNn498560@f0.sw.ru> List-Id: The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-211.39.1.16.2.vz10 ------> commit caffa03f46b7f603cc9b187322ad80332f44e423 Author: Konstantin Khorenko Date: Mon Jul 6 12:59:42 2026 +0200 ve/mm: enforce the 0..100 bound on vfs_cache_min_ratio The vfs_cache_min_ratio sysctl was registered with .extra1 = SYSCTL_ZERO .extra2 = SYSCTL_ONE_HUNDRED but with .proc_handler = proc_dointvec. proc_dointvec() ignores extra1/extra2, so the intended [0, 100] clamp was never applied and any value (e.g. 101 or negative) was accepted. Use proc_dointvec_minmax() so the already-declared bounds are honoured and an out-of-range write is rejected with -EINVAL. Fixes: b1d8855b18e5b ("ve/mm: introduce min threshold for dcache") Feature: mm: threshold for minimal dcache amount https://virtuozzo.atlassian.net/browse/VSTOR-137234 Signed-off-by: Konstantin Khorenko Reviewed-by: Pavel Tikhomirov --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 8bb2c2de769e2..cd2d91dca858c 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2161,7 +2161,7 @@ static struct ctl_table vm_table[] = { .data = &sysctl_vfs_cache_min_ratio, .maxlen = sizeof(sysctl_vfs_cache_min_ratio), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE_HUNDRED, },