Re: more specific TCP bindings

Andi Kleen (ak@muc.de)
19 Oct 1998 10:09:41 +0200


In article <Pine.BSF.4.03.9810181640060.20832-100000@alive.znep.com>,
Marc Slemko <marcs@znep.com> writes:
> marcs@lerkim:~$ nc -v -l -p 8888 &
> [1] 6475
> marcs@lerkim:~$ listening on [any] 8888 ...
> nc -v -l -p 8888 -s localhost
> retrying local 127.0.0.1:8888 : Address already in use

> marcs@lerkim:~$ nc -u -v -l -p 8888 &
> [1] 6477
> marcs@lerkim:~$ listening on [any] 8888 ...
> nc -u -v -l -p 8888 -s localhost
> listening on [127.0.0.1] 8888 ...

> If I bind a TCP socket to INADDR_ANY with SO_REUSEADDR set, then try to
> bind to a specific address, it is denied. Trying to do the same thing
> works with UDP.

> Aside from the fact that being able to do this is a useful feature, it is
> inconsistent between UDP and TCP.
Being able to do this is a security hole because you can steal packets
from other processes then. If UDP allows it is a bug IMHO.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/