lkml.org 
[lkml]   [2001]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: SO_REUSEADDR redux

Paul D. Smith writes:
> %% Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
>
> >> This application uses SO_REUSEADDR in conjunction with INADDR_ANY. What
> >> it does is bind() to INADDR_ANY, then listen(). Then, it proceeds to
> >> bind (but _not_ listen) various other specific addresses.
>
> ac> That should be ok if its setting SO_REUSEADDR
>
> I agree, and so does Solaris/FreeBSD, but Linux doesn't.

After reading up some code, FreeBSD does do a bind() check which is
just as restrictive as Linux's except that they allow INADDR_ANY
combinations when the credentials of the user doing the bind() match
the credentials of all other sockets bound to that port.

I don't think we should change our behavior. Allowing the combination
in question only when the UIDs match between the socket owners is
dubious at best.

I actually went to the FreeBSD code because what Steven's showed
was extremely loose in what it let through. It allowed the nfs
port override trick Alan mentioned.

Later,
David S. Miller
davem@redhat.com

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

\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.043 / U:2.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site