From owner-cvs-all Sun Nov 22 16:45:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA03524 for cvs-all-outgoing; Sun, 22 Nov 1998 16:45:38 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA03519; Sun, 22 Nov 1998 16:45:37 -0800 (PST) (envelope-from truckman@FreeBSD.org) From: Don Lewis Received: (from truckman@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id QAA04343; Sun, 22 Nov 1998 16:45:42 -0800 (PST) Date: Sun, 22 Nov 1998 16:45:42 -0800 (PST) Message-Id: <199811230045.QAA04343@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: cvs commit: src/sys/kern uipc_socket2.c uipc_syscalls.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk truckman 1998/11/22 16:45:42 PST Modified files: sys/kern uipc_socket2.c uipc_syscalls.c Log: 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 . Revision Changes Path 1.42 +1 -2 src/sys/kern/uipc_socket2.c 1.47 +3 -1 src/sys/kern/uipc_syscalls.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message