Date: Wed, 25 Feb 2009 15:04:30 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern kern_descrip.c Message-ID: <200902251504.n1PF4aJZ082281@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2009-02-25 15:04:30 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern kern_descrip.c Log: SVN rev 189044 on 2009-02-25 15:04:30Z by rwatson Merge r188485 from head to stable/7: Modify fdcopy() so that, during fork(2), it won't copy file descriptors from the parent to the child process if they have an operation vector of &badfileops. This narrows a set of races involving system calls that allocate a new file descriptor, potentially block for some extended period, and then return the file descriptor, when invoked by a threaded program that concurrently invokes fork(2). Similar approches are used in both Solaris and Linux, and the wideness of this race was introduced in FreeBSD when we moved to a more optimistic implementation of accept(2) in order to simplify locking. A small race necessarily remains because the fork(2) might occur after the finit() in accept(2) but before the system call has returned, but that appears unavoidable using current APIs. However, this race is vastly narrower. The fix can be validated using the newfileops_on_fork regression test. PR: kern/130348 Reported by: Ivan Shcheklein <shcheklein at gmail dot com> Reviewed by: jhb, kib Revision Changes Path 1.313.2.16 +2 -1 src/sys/kern/kern_descrip.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902251504.n1PF4aJZ082281>