Skip to content

Commit ffb6ca3

Browse files
fsorensontrondmypd
authored andcommitted
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>
1 parent e08ea3a commit ffb6ca3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/sunrpc/xprtsock.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3153,8 +3153,12 @@ static int param_set_uint_minmax(const char *val,
31533153

31543154
static int param_set_portnr(const char *val, const struct kernel_param *kp)
31553155
{
3156-
return param_set_uint_minmax(val, kp,
3156+
if (kp->arg == &xprt_min_resvport)
3157+
return param_set_uint_minmax(val, kp,
31573158
RPC_MIN_RESVPORT,
3159+
xprt_max_resvport);
3160+
return param_set_uint_minmax(val, kp,
3161+
xprt_min_resvport,
31583162
RPC_MAX_RESVPORT);
31593163
}
31603164

0 commit comments

Comments
 (0)