[Devel] [PATCH RHEL9 COMMIT] Revert "Revert "sysctl: return -EINVAL if val violates minmax""

Konstantin Khorenko khorenko at virtuozzo.com
Tue Feb 1 17:46:41 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-4.vz9.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.12.4
------>
commit cf4e91dc38f4bf5a293609c7b5fa4683661a8cb5
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Tue Feb 1 17:44:33 2022 +0300

    Revert "Revert "sysctl: return -EINVAL if val violates minmax""
    
    This reverts commit 99540bb30093687c6de51f8f68129ab18d8ee66a.
    
    We have completed switched to vzlinux 9 userspace environment =>
    no need for this crutch anymore.
    
    https://jira.sw.ru/browse/PSBM-135121
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/sysctl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index bc54de3f236f..9bb8935f9b55 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1270,8 +1270,10 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table,
 			if (neg)
 				continue;
 			val = convmul * val / convdiv;
-			if ((min && val < *min) || (max && val > *max))
-				continue;
+			if ((min && val < *min) || (max && val > *max)) {
+				err = -EINVAL;
+				break;
+			}
 			*i = val;
 		} else {
 			val = convdiv * (*i) / convmul;


More information about the Devel mailing list