Subject: Re: stopping childs (patch included)
To: Emmanuel Dreyfus <manu@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 11/29/2002 18:23:20
> I'll rework this with two single bit flags, which remains set to 1 until
> you explicitely remove it. In the meantime, if nobody oppose I'll commit
> the short int value support to sysctl, someone might need it later.

I noticed you've added:
	/*
	 * Inherit STOPFORK and STOPEXEC flags 
	 */
	if (p1->p_flag & P_STOPFORK)
		p2->p_flag |= P_STOPFORK;
	if (p1->p_flag & P_STOPEXEC)
		p2->p_flag |= P_STOPEXEC;
to inherit the flags.

I think (especially if the SMP kernel gets finer locking) that the
child can run (and possibly exit!) before this is done.

It would surely be better to do this much earlier (eg when the
other p_flags are set).  The simpler:
	 p2->p_flag |= p1->p_flag & (P_STOPFORK | P_STOPEXEC);
will suffice.

	David

-- 
David Laight: david@l8s.co.uk