Official MINIX sources - Automatically replicated from gerrit.minix3.org
Go to file
David van Moolenbroek b40debead8 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
2013-11-06 01:07:41 +01:00
benchmarks Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
bin work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
commands PM: remove obsolete ALARM, PAUSE, TIMES calls 2013-11-05 18:26:11 +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 2013-11-06 01:07:32 +01:00
docs Allow install of binutils and import texinfo 2013-07-12 14:18:08 +02:00
drivers work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
etc work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
external work-3.2.1 squash commit 2013-11-05 18:25:04 +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 2013-11-05 18:26:11 +01:00
kernel Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2013-11-05 18:25:59 +01:00
lib PM: remove obsolete ALARM, PAUSE, TIMES calls 2013-11-05 18:26:11 +01:00
libexec increase -Werror resilience 2013-08-21 13:53:39 +02:00
man PM: remove obsolete ALARM, PAUSE, TIMES calls 2013-11-05 18:26:11 +01:00
releasetools work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
sbin work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
servers PM: resolve fork/kill race condition 2013-11-06 01:07:41 +01:00
share Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2013-11-05 18:25:59 +01:00
sys work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
test PM: resolve fork/kill race condition 2013-11-06 01:07:41 +01:00
tests fix a few more minix specific warnings 2013-08-27 16:16:03 +00:00
tools x86 hd image creator 2013-09-25 19:30:22 +02:00
usr.bin work-3.2.1 squash commit 2013-11-05 18:25:04 +01:00
usr.sbin work-3.2.1 squash commit 2013-11-05 18:25:04 +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