Skip to content

Commit

Permalink
sunrpc: Prevent resvport min/max inversion via sysctl
Browse files Browse the repository at this point in the history
The current min/max resvport settings are independently limited
by the entire range of allowed ports, so max_resvport can be
set to a port lower than min_resvport.

Prevent inversion of min/max values when set through sysctl by
setting the limits dependent on each other.

Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Frank Sorenson authored and Trond Myklebust committed Jul 19, 2016
1 parent 5d71899 commit e08ea3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ static struct ctl_table xs_tunables_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xprt_min_resvport_limit,
.extra2 = &xprt_max_resvport_limit
.extra2 = &xprt_max_resvport
},
{
.procname = "max_resvport",
.data = &xprt_max_resvport,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xprt_min_resvport_limit,
.extra1 = &xprt_min_resvport,
.extra2 = &xprt_max_resvport_limit
},
{
Expand Down

0 comments on commit e08ea3a

Please sign in to comment.