Go to file
David van Moolenbroek f310aefcbd PM: resolve fork/kill race condition
When a process forks, VFS is informed on behalf of the child. This is
correct, because otherwise signals to the new child could get lost.
However, that means that the parent is not blocked from being killed
by a signal while the child is blocked on this VFS call. As a result,
by the time that the VFS reply comes in, the parent may already be
dead, and the child may thus have been assigned a new parent: INIT.

Previously, PM would blindly reply to the parent when the VFS reply
for the fork came in. Thus, it could end up sending a reply to INIT,
even though INIT did not issue the fork(2) call. This could end up
satisfying a different call from INIT (typically waitpid(2)) and then
cause an error when that other call was complete.

It would be possible to set VFS_CALL on both forking parent and child.
This patch instead adds a flag (NEW_PARENT) to note that a process's
parent has changed during a VFS call.

Change-Id: Iad930b2e441db54fe6f7d2fd011f0f6a26e2923d
2014-03-01 09:04:59 +01:00
benchmarks Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
bin Import NetBSD df(1) 2014-02-18 11:25:02 +01:00
commands PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
common a bit more -Werror compatability 2013-08-20 11:37:40 +02:00
dist/nvi Termcap update, replacing elvis by nvi. 2013-01-24 07:44:38 +01:00
distrib PM: rework signal handling 2014-03-01 09:04:59 +01:00
docs Allow install of binutils and import texinfo 2013-07-12 14:18:08 +02:00
drivers TTY: fix earlier PTY select "improvement" 2014-03-01 09:04:58 +01:00
etc Extend dupfrom(2) into copyfd(2) 2014-03-01 09:04:58 +01:00
external netbsd dirent.h, import sys/sys *.h, mfs cleanup 2014-03-01 09:04:59 +01:00
gnu Prevent make -C gnu from installing files in / 2013-09-17 15:19:50 +02:00
include PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
kernel Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
lib PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
libexec Remove obsolete compatibility links 2014-03-01 09:04:56 +01:00
man PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
releasetools usr.bin/man: Update 2014-03-01 09:04:56 +01:00
sbin netbsd dirent.h, import sys/sys *.h, mfs cleanup 2014-03-01 09:04:59 +01:00
servers PM: resolve fork/kill race condition 2014-03-01 09:04:59 +01:00
share Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
sys netbsd dirent.h, import sys/sys *.h, mfs cleanup 2014-03-01 09:04:59 +01:00
test PM: resolve fork/kill race condition 2014-03-01 09:04:59 +01:00
tests Importing usr.bin/id 2013-11-12 10:15:47 -05:00
tools x86_hdimage.sh -i: crossbuild x86 release CD 2013-11-07 13:44:22 +00:00
usr.bin usr.bin/man: Update 2014-03-01 09:04:56 +01:00
usr.sbin netbsd dirent.h, import sys/sys *.h, mfs cleanup 2014-03-01 09:04:59 +01:00
.gitignore gitignore: ignore some more generated files 2012-12-06 13:29:20 +00:00
.gitreview misc:Add gerrit code review support. 2013-01-16 09:44:16 +01:00
build.sh Reverting back to default value of MKARZERO 2013-01-17 10:03:58 +01:00
LICENSE Fix parameter parsing in cut 2010-01-21 10:16:05 +00:00
Makefile Importing NetBSD "Kyua" test framework 2013-07-23 20:43:41 +02:00