diff options
author | Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr> | 2025-02-24 12:58:17 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2025-03-10 16:11:13 +0300 |
commit | 87480a8ce567340a518d992678224c09afab5f11 (patch) | |
tree | d6ced69b3f74a859c4c5361628f76626f56d71b4 | |
parent | 261e3bbf9747e9c7c87b3bce519df94754e24ed8 (diff) | |
download | linux-87480a8ce567340a518d992678224c09afab5f11.tar.xz |
sysctl: Fixes nsm_local_state bounds
Bound nsm_local_state sysctl writings between SYSCTL_ZERO
and SYSCTL_INT_MAX.
The proc_handler has thus been updated to proc_dointvec_minmax.
Signed-off-by: Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>
[ cel: updated to handle zero - UINT_MAX instead ]
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r-- | fs/lockd/svc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 256284669aaa..e80262a51884 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -467,9 +467,10 @@ static const struct ctl_table nlm_sysctls[] = { { .procname = "nsm_local_state", .data = &nsm_local_state, - .maxlen = sizeof(int), + .maxlen = sizeof(nsm_local_state), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_douintvec, + .extra1 = SYSCTL_ZERO, }, }; |