truckman 0b3bd2def8 We can't call fsetown() from sonewconn() because sonewconn() is be called
from an interrupt context and fsetown() wants to peek at curproc, call
malloc(..., M_WAITOK), and fiddle with various unprotected data structures.
The fix is to move the code that duplicates the F_SETOWN/FIOSETOWN state
of the original socket to the new socket from sonewconn() to accept1(),
since accept1() runs in the correct context.  Deferring this until the
process calls accept() is harmless since the process can't do anything
useful with SIGIO on the new socket until it has the descriptor for that
socket.

One could make the case for not bothering to duplicate the
F_SETOWN/FIOSETOWN state and requiring the process to explicitly make the
fcntl() or ioctl() call on the new socket, but this would be incompatible
with the previous implementation and might break programs which rely on
the old semantics.

This bug was discovered by Andrew Gallatin <gallatin@cs.duke.edu>.
1998-11-23 00:45:39 +00:00
..
1998-10-15 17:09:19 +00:00
1998-11-11 12:57:05 +00:00
1998-08-04 09:21:04 +00:00
1998-11-15 18:11:21 +00:00
1998-08-23 10:16:26 +00:00
1998-11-11 12:57:05 +00:00
1998-09-14 19:56:42 +00:00
1998-09-14 19:56:42 +00:00