Skip to content

Commit 87480a8

Browse files
nbouchinet-anssichucklever
authored andcommitted
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>
1 parent 261e3bb commit 87480a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/lockd/svc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,10 @@ static const struct ctl_table nlm_sysctls[] = {
467467
{
468468
.procname = "nsm_local_state",
469469
.data = &nsm_local_state,
470-
.maxlen = sizeof(int),
470+
.maxlen = sizeof(nsm_local_state),
471471
.mode = 0644,
472-
.proc_handler = proc_dointvec,
472+
.proc_handler = proc_douintvec,
473+
.extra1 = SYSCTL_ZERO,
473474
},
474475
};
475476

0 commit comments

Comments
 (0)