Skip to content

Commit

Permalink
sysctl: Fixes nsm_local_state bounds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Bouchinet authored and Chuck Lever committed Mar 10, 2025
1 parent 261e3bb commit 87480a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand Down

0 comments on commit 87480a8

Please sign in to comment.