• J
    sunrpc: safely reallow resvport min/max inversion · 826799e6
    J. Bruce Fields 提交于
    Commits ffb6ca33 and e08ea3a9 prevent setting xprt_min_resvport
    greater than xprt_max_resvport, but may also break simple code that sets
    one parameter then the other, if the new range does not overlap the old.
    
    Also it looks racy to me, unless there's some serialization I'm not
    seeing.  Granted it would probably require malicious privileged processes
    (unless there's a chance these might eventually be settable in unprivileged
    containers), but still it seems better not to let userspace panic the
    kernel.
    
    Simpler seems to be to allow setting the parameters to whatever you want
    but interpret xprt_min_resvport > xprt_max_resvport as the empty range.
    
    Fixes: ffb6ca33 "sunrpc: Prevent resvport min/max inversion..."
    Fixes: e08ea3a9 "sunrpc: Prevent rexvport min/max inversion..."
    Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
    Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
    826799e6
xprtsock.c 81.9 KB