[Devel] [PATCH RHEL10 COMMIT] ve/mm: enforce the 0..100 bound on vfs_cache_min_ratio

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 5 15:01:15 MSK 2026


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 <khorenko at virtuozzo.com>
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 <khorenko at virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 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,
 	},


More information about the Devel mailing list