Re: SO_REUSEADDR not allowing server and client to use same port

From: Willy Tarreau
Date: Thu Feb 28 2008 - 15:42:26 EST


On Thu, Feb 28, 2008 at 08:19:26PM +0000, Alan Cox wrote:
> > Currently, Linux does not allow reuse of same local port for both TCP server and
> > TCP client. I understand that there may be a need to prevent two servers from
>
> Think about what happens for simultaneous connect (that obscure little
> corner of the tcp/ip spec). Now think about what it means for security.
>
> ALan

exactly. That's why I think that requiring the server to explicitly allow
socket reuse is mandatory. On another side of the problem, I really think
that we should make the simultaneous connect configurable. I've been patching
all of my own 2.4 kernels for a while to add a config option to turn it off
because there is a real security issue with this on. At least for mainline,
it should be a sysctl. No stateful firewall I know supports the feature, so
legitimate uses of this feature are likely very very small.

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