LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [discuss] portmapping sucks
@ 2007-01-24 23:50 Jan Engelhardt
  2007-01-25  0:19 ` Trent Waddington
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Engelhardt @ 2007-01-24 23:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hello list,


I just don't know where else I could send this, it's sooo generic to 
Linux and UNIX (perhaps blame SUN for inventing portmap?)
Well, here goes...

As we all know, mountd and other SUNRPC (I question this invention too) 
services are at a fixed RPC port number (/etc/rpc) which are mapped 
to a random TCP/UDP port, and the application doing the mappings is
portmap. This random TCP/UDP port selection is what makes it suck.

Already twice in 6 months, it has occurred to me that mountd was 
assigned to vital TCP ports, among which there was:

631/tcp causing
  - cups could not start up properly
  - samba went into an infinite loop upon startup trying
    to access port 631 with IPP

There are a number of common ports in the 512-1023 range. All 
obsolescence and meaninglessness aside, there _are_ rather "important" 
services in that range, ldaps, rtsp, kerberos, rsync, ftps, imaps, just 
to name a few from /etc/services. This map-to-random-port behavior is a 
total DoS thing.

Not starting portmap until boot has finished does not work. Think 
of importing NFS beforehand (/usr, anyone?). Even if, your admin would 
be very puzzled if he finds that normally-disabled daemons cannot be 
started at any later time.

At best I'd obsolete the whole SUNRPC stuff, do away with portmap (and 
just use TCP/UDP port numbers already) and have a LOT of code simplified 
(portmap registration for knfsd, to name a prime example).
Or at least give it fixed TCP/UDP/etc. port numbers too.

Request for discussion.


Thanks,
Jan
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [discuss] portmapping sucks
  2007-01-24 23:50 [discuss] portmapping sucks Jan Engelhardt
@ 2007-01-25  0:19 ` Trent Waddington
  2007-01-25  3:10 ` Trond Myklebust
  2007-01-26  0:14 ` Henrique de Moraes Holschuh
  2 siblings, 0 replies; 4+ messages in thread
From: Trent Waddington @ 2007-01-25  0:19 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux Kernel Mailing List

On 1/25/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> There are a number of common ports in the 512-1023 range. All
> obsolescence and meaninglessness aside, there _are_ rather "important"
> services in that range, ldaps, rtsp, kerberos, rsync, ftps, imaps, just
> to name a few from /etc/services. This map-to-random-port behavior is a
> total DoS thing.

Any reason why you can't make a one line code change to use a better
range?  Or add a blacklist?

Trent

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [discuss] portmapping sucks
  2007-01-24 23:50 [discuss] portmapping sucks Jan Engelhardt
  2007-01-25  0:19 ` Trent Waddington
@ 2007-01-25  3:10 ` Trond Myklebust
  2007-01-26  0:14 ` Henrique de Moraes Holschuh
  2 siblings, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2007-01-25  3:10 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux Kernel Mailing List

On Thu, 2007-01-25 at 00:50 +0100, Jan Engelhardt wrote:
> Hello list,
> 
> 
> I just don't know where else I could send this, it's sooo generic to 
> Linux and UNIX (perhaps blame SUN for inventing portmap?)
> Well, here goes...
> 
> As we all know, mountd and other SUNRPC (I question this invention too) 
> services are at a fixed RPC port number (/etc/rpc) which are mapped 
> to a random TCP/UDP port, and the application doing the mappings is
> portmap. This random TCP/UDP port selection is what makes it suck.
> 
> Already twice in 6 months, it has occurred to me that mountd was 
> assigned to vital TCP ports, among which there was:
> 
> 631/tcp causing
>   - cups could not start up properly
>   - samba went into an infinite loop upon startup trying
>     to access port 631 with IPP
> 
> There are a number of common ports in the 512-1023 range. All 
> obsolescence and meaninglessness aside, there _are_ rather "important" 
> services in that range, ldaps, rtsp, kerberos, rsync, ftps, imaps, just 
> to name a few from /etc/services. This map-to-random-port behavior is a 
> total DoS thing.
> 
> Not starting portmap until boot has finished does not work. Think 
> of importing NFS beforehand (/usr, anyone?). Even if, your admin would 
> be very puzzled if he finds that normally-disabled daemons cannot be 
> started at any later time.
> 
> At best I'd obsolete the whole SUNRPC stuff, do away with portmap (and 
> just use TCP/UDP port numbers already) and have a LOT of code simplified 
> (portmap registration for knfsd, to name a prime example).
> Or at least give it fixed TCP/UDP/etc. port numbers too.

1) What the hell does this have to do with the kernel mailing list?

2) Then assign a bloody port number to mountd, and stick to it. Why do
you think there is a '-p' command line option in the first place?

Trond


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [discuss] portmapping sucks
  2007-01-24 23:50 [discuss] portmapping sucks Jan Engelhardt
  2007-01-25  0:19 ` Trent Waddington
  2007-01-25  3:10 ` Trond Myklebust
@ 2007-01-26  0:14 ` Henrique de Moraes Holschuh
  2 siblings, 0 replies; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-01-26  0:14 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux Kernel Mailing List

On Thu, 25 Jan 2007, Jan Engelhardt wrote:
> As we all know, mountd and other SUNRPC (I question this invention too) 
> services are at a fixed RPC port number (/etc/rpc) which are mapped 
> to a random TCP/UDP port, and the application doing the mappings is
> portmap. This random TCP/UDP port selection is what makes it suck.

1. This is OT here.
2. See "portreserve" in Debian for a possible solution (that nobody in
Debian paid any attention to, so it never reserves anything :p).  Other
distros (RedHat/Fedora?) might have it too.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-26  0:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-24 23:50 [discuss] portmapping sucks Jan Engelhardt
2007-01-25  0:19 ` Trent Waddington
2007-01-25  3:10 ` Trond Myklebust
2007-01-26  0:14 ` Henrique de Moraes Holschuh

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).