summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorFrank Sorenson <sorenson@redhat.com>2016-07-08 23:35:25 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-07-19 22:23:27 +0200
commitffb6ca33b04b965ac7dd10676537b93e2476dcec (patch)
tree7ce4abe91fb16fe66eff213b984546f57c0f6380 /net/sunrpc
parentsunrpc: Prevent resvport min/max inversion via sysctl (diff)
downloadlinux-ffb6ca33b04b965ac7dd10676537b93e2476dcec.tar.xz
linux-ffb6ca33b04b965ac7dd10676537b93e2476dcec.zip
sunrpc: Prevent resvport min/max inversion via sysfs and module parameter
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 sysfs and module parameter 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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 2674309770f4..83e6f3316149 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -3153,8 +3153,12 @@ static int param_set_uint_minmax(const char *val,
static int param_set_portnr(const char *val, const struct kernel_param *kp)
{
- return param_set_uint_minmax(val, kp,
+ if (kp->arg == &xprt_min_resvport)
+ return param_set_uint_minmax(val, kp,
RPC_MIN_RESVPORT,
+ xprt_max_resvport);
+ return param_set_uint_minmax(val, kp,
+ xprt_min_resvport,
RPC_MAX_RESVPORT);
}