netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chris Friesen" <cfriesen@nortel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	netdev@vger.kernel.org,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: sunrpc port allocation and IANA reserved list
Date: Tue, 10 Nov 2009 15:54:15 -0600	[thread overview]
Message-ID: <4AF9E107.8050605@nortel.com> (raw)
In-Reply-To: <1257888720.2834.30.camel@achroite.uk.solarflarecom.com>

On 11/10/2009 03:32 PM, Ben Hutchings wrote:

> I'm sure we could afford 128 bytes for a blacklist of privileged ports.
> However, the problem is that there is no API for userland to request
> 'any free privileged port' - it has to just try binding to different
> ports until it finds one available.  This means that the kernel can't
> tell whether a process is trying to allocate a specifically assigned
> port or whether the blacklist should be applied.

That's unfortunate.  Maybe a bindresvport syscall would make sense, but
that's starting to get bloated.  At least for userspace apps netstat
will show who the owner is and it might be possible to clean it up
without rebooting.

For the ports allocated in the kernel via xs_get_random_port() and
xprt_bindresvport() it would be fairly easy to check a blacklist.

Interestingly, the current kernel range starts at 665 because IPMI is
known to use 664.  The current glibc range to be tried in bindresvport()
starts at 600, which seems to be a bug waiting to happen.

Chris

  parent reply	other threads:[~2009-11-10 21:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10 17:43 sunrpc port allocation and IANA reserved list Chris Friesen
2009-11-10 17:53 ` Ben Hutchings
2009-11-10 18:37   ` Chris Friesen
2009-11-10 18:48     ` Chris Friesen
2009-11-10 20:26     ` Trond Myklebust
2009-11-10 21:06       ` Chris Friesen
2009-11-10 21:17         ` Trond Myklebust
2009-11-10 21:58           ` Trond Myklebust
2009-11-10 21:32         ` Ben Hutchings
2009-11-10 21:34           ` Chuck Lever
2009-11-10 21:42             ` Ben Hutchings
2009-11-10 21:54           ` Chris Friesen [this message]
2009-11-10 22:14           ` Trond Myklebust

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=4AF9E107.8050605@nortel.com \
    --to=cfriesen@nortel.com \
    --cc=bhutchings@solarflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /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).