minix/servers/pm
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
..
alarm.c PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
break.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
const.h Fix a few compile time warnings 2010-07-02 12:41:19 +00:00
exec.c Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
forkexit.c PM: resolve fork/kill race condition 2014-03-01 09:04:59 +01:00
getset.c fix some warnings 2013-05-31 20:57:39 +00:00
glo.h PM: remove obsolete sys_getkinfo() 2013-08-06 11:46:46 +02:00
main.c PM: resolve fork/kill race condition 2014-03-01 09:04:59 +01:00
Makefile Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
mcontext.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
misc.c uname: normalize release and version 2014-03-01 09:04:55 +01:00
mproc.h PM: resolve fork/kill race condition 2014-03-01 09:04:59 +01:00
param.h PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
pm.h Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
profile.c profiling related cleanup 2012-07-15 21:56:55 +02:00
proto.h PM: rework signal handling 2014-03-01 09:04:59 +01:00
schedule.c Replacing timer_t by netbsd's timer_t 2014-03-01 09:04:54 +01:00
signal.c PM: rework signal handling 2014-03-01 09:04:59 +01:00
table.c PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
time.c PM: remove obsolete ALARM, PAUSE, TIMES calls 2014-03-01 09:04:59 +01:00
trace.c PM: rework signal handling 2014-03-01 09:04:59 +01:00
type.h Removed 'system process' magic from PM and FS. 2005-05-13 08:57:08 +00:00
utility.c Replacing timer_t by netbsd's timer_t 2014-03-01 09:04:54 +01:00