Bugtraq mailing list archives

Re: Linux inetd..


From: alan () LXORGUK UKUU ORG UK (Alan Cox)
Date: Tue, 2 Dec 1997 20:50:01 +0000


Now you may be wondering why does a write to the socket returned by
accept() generates a SIGPIPE. This bring us to the second issue. It seems
that at least under Linux 2.0.X accept will return a socket in the
received queue if it is not in the SYN_SENT or SYN_RECV state, even when
it has not gone through the ESTABLISHED state.

By doing a stealth scan on the port the socket goes from the SYN_RECV
state to the CLOSED state. When you try to read from such a socket you
get a SIGPIPE. The sematics of Linux's accept seems to be non-standard. I
wonder what else breaks by not handling SIGPIPE.

On that issue you are a little astray. Linux merely made the window for
the inetd problem a bit larger. You can hit a box betwen the accept
returning towards user space and the write() with a seperate RST frame
regardless of what accept returns. If generic BSD has this missing
SIGPIPE I venture to say that if you can hit the precise boundary needed
you can bring down inetd there too.

ie
                SYN/ SYN-RECV/ ACK
        accept()
                RST
        write()
        SIGPIPE

Alan



Current thread: