From: Guillem Jover <gjover@sipwise.com>
To: Steve Dickson <SteveD@RedHat.com>
Cc: libtirpc-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] Do not bind to reserved ports registered in /etc/services
Date: Fri, 12 Jan 2018 19:41:51 +0100 [thread overview]
Message-ID: <20180112184151.GA10261@thunder.hadrons.org> (raw)
In-Reply-To: <e18f29cd-639d-be9d-ee93-80df592468db@RedHat.com>
On Thu, 2018-01-11 at 10:18:46 -0500, Steve Dickson wrote:
> Overall I think this makes sense, but this eliminates 240 privilege
> ports and worried we would run out of port (due to them in TIME_WAIT)
> during a v3 mount storms. A port goes into TIME_WAIT after a v3 mount
> is done... But on the other hand v3 is no longer the default and
> there are 784 available ports.... Hopefully that is enough.
Hmm, those numbers do not match my own. bindresvport() uses the port
range between 512 and 1023 inclusive. On my Debian stable (stretch)
and unstable systems these are the number of registered ports in
/etc/services:
,---
# UDP
$ awk '/^[^#]/ { print $2 }' /etc/services | \
sed -n -e 's,/udp,,p' | \
while read port; do if [ $port -ge 512 -a $port -lt 1024 ]; \
then echo $port; fi; done | sort -u | wc -l
31
# TCP
$ awk '/^[^#]/ { print $2 }' /etc/services | \
sed -n -e 's,/tcp,,p' | \
while read port; do if [ $port -ge 512 -a $port -lt 1024 ]; \
then echo $port; fi; done | sort -u | wc -l
48
`---
So that's pretty low. Not as low as the 9 listed in
/etc/bindresvport.blacklist, but as I've mentioned on the other reply,
given that the list is incomplete and that does not support dynamically
registering the ports being actively used on the current system with a
".d/" style fragments directory, it would eventually require to ship
all the ports already listed in /etc/services anyway, which gains us
nothing.
In addition I notice now that even the comment in that file (at least on
Debian) is bogus, as it does not account for ports between 512 and 599:
,--- /etc/bindresvport.blacklist
#
# This file contains a list of port numbers between 600 and 1024,
# which should not be used by bindresvport. bindresvport is mostly
# called by RPC services. This mostly solves the problem, that a
# RPC service uses a well known port of another service.
#
`---
:)
Thanks,
Guillem
next prev parent reply other threads:[~2018-01-12 18:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 0:49 [PATCH] Do not bind to reserved ports registered in /etc/services Guillem Jover
2018-01-11 15:18 ` Steve Dickson
2018-01-12 18:41 ` Guillem Jover [this message]
2018-01-12 19:12 ` [Libtirpc-devel] " Thorsten Kukuk
2018-01-12 19:19 ` Tom Talpey
2018-02-08 18:07 ` Chuck Lever
2018-02-08 18:36 ` Chuck Lever
2018-03-06 18:09 ` Chuck Lever
2018-03-08 20:24 ` J. Bruce Fields
2018-03-08 21:26 ` J. Bruce Fields
2018-03-08 21:28 ` [Libtirpc-devel] " Chuck Lever
2018-03-08 21:35 ` Bruce Fields
2018-01-11 15:50 ` Chuck Lever
2018-01-12 18:05 ` Guillem Jover
2018-01-12 19:12 ` Chuck Lever
2018-01-12 21:12 ` [Libtirpc-devel] " Thorsten Kukuk
2018-01-12 21:14 ` Chuck Lever
2018-01-12 21:30 ` Matt Benjamin
2018-01-12 22:08 ` Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180112184151.GA10261@thunder.hadrons.org \
--to=gjover@sipwise.com \
--cc=SteveD@RedHat.com \
--cc=libtirpc-devel@lists.sourceforge.net \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).