Bugtraq mailing list archives
NetBSD Security Advisory 1999-001: select(2)/accept(2) race
From: djb () CR YP TO (D. J. Bernstein)
Date: Thu, 21 Jan 1999 05:19:24 -0000
One workaround is to run servers under tcpserver: http://pobox.com/~djb/ucspi-tcp.html tcpserver handles a single TCP port with a simple accept() loop. ---Dan P.S. The same bug shows up in (for example) select()+write() if there's more than one process writing to the same open file. Non-blocking I/O is unsatisfactory, as discussed in http://pobox.com/~djb/docs/unixapi.html: Non-blocking I/O (O_NDELAY/O_NONBLOCK) is a feature of an open file. This means that a program cannot set non-blocking I/O for open files shared with other processes, such as stdout; it will screw up other processes that try writing to the same open file at the same time. Resulting reliability problem: If a multiplexing program uses select() to see when it can safely write to a pipe on stdout, and then does the write, it may end up blocking: another process may have filled the pipe just after select() returned. One workaround is to schedule signals to interrupt each I/O operation, but this is unnecessarily difficult to program. Vendors should provide ndelay_read() and ndelay_write() syscalls that do not block. As John Whittaker says: ``It's UNIX. That doesn't necessarily mean it's right.''
Current thread:
- Re: NetBSD Security Advisory 1999-001: select(2)/accept(2) race, (continued)
- Re: NetBSD Security Advisory 1999-001: select(2)/accept(2) race Alan Cox (Jan 23)
- Mirc 5.5 'DCC Server' hole Spikeman (Jan 24)
- Re: Mirc 5.5 'DCC Server' hole Sandro Jurado (Jan 26)
- Re: NetBSD Security Advisory 1999-001: select(2)/accept(2) race Casper Dik (Jan 25)
- Announcement: Wietse's FTP site has moved Wietse Venema (Jan 25)
- Re: NetBSD Security Advisory 1999-001: select(2)/accept(2) race Alan Cox (Jan 23)
- Keeping Solaris up-to-date: summary John RIddoch (Jan 20)
- FW: Personal web server - Temporary Fix Ollie Whitehouse (Jan 20)
- Nobo and Netbuster Dos Wolfgang Gassner (Jan 20)
- Re: Nobo and Netbuster Dos Flavio Veloso (Jan 21)
- Quake 2 Server Crash Leif Sawyer (Jan 20)
- NetBSD Security Advisory 1999-001: select(2)/accept(2) race D. J. Bernstein (Jan 20)
- Sendmail 8.8.x/8.9.x bugware Gregory Neil Shapiro (Jan 20)
- CFP: New Security Paradigms Workshop 1999 Crispin Cowan (Jan 21)
- Re: Sendmail 8.8.x/8.9.x bugware Phil Stracchino (Jan 21)
- Re: Sendmail 8.8.x/8.9.x bugware Phil Stracchino (Jan 21)
- linux crashes irix6.3 Philipp Schott (Jan 22)
- Re: linux crashes irix6.3 J.A. Gutierrez (Jan 23)
- CERT Advisory CA-99.01 - TCP.Wrappers (fwd) //Stany (Jan 22)
- Misleading CERT Advisory CA-99-01-Trojan-TCP-Wrappers Jochen Thomas Bauer (Jan 22)
- Follow up - IIS 4 logging mnemonix (Jan 23)