NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/50308: PS_STOPEXIT processes don't correctly handle b_nstopchild



>Number:         50308
>Category:       kern
>Synopsis:       PS_STOPEXIT processes don't correctly handle b_nstopchild
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 07 00:00:00 +0000 2015
>Originator:     paul%whooppee.com@localhost
>Release:        NetBSD 7.99.21
>Organization:
+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+
>Environment:
	
	
System: NetBSD pokey.whooppee.com 7.99.21 NetBSD 7.99.21 (POKEY 2015-09-20 02:09:58) #0: Sun Sep 20 14:01:44 PHT 2015 paul%pokey.whooppee.com@localhost:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/POKEY amd64
Architecture: x86_64
Machine: amd64
>Description:
	In src/sys/kern/kern_exit.c, processes flagged with PS_STOPEXIT
	do not update the parent process's p_nstopchild counter.  So
	the parent process might not process its entire p_children list
	and thus might not reap all of its exitted children.
	
>How-To-Repeat:
	Found by code-inspection.
	
>Fix:
Index: kern/kern_exit.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_exit.c,v
retrieving revision 1.245
diff -u -p -r1.245 kern_exit.c
--- kern/kern_exit.c    2 Oct 2015 16:54:15 -0000       1.245
+++ kern/kern_exit.c    6 Oct 2015 11:38:04 -0000
@@ -227,7 +227,10 @@ exit1(struct lwp *l, int rv)
 	if (__predict_false(p->p_sflag & PS_STOPEXIT)) {
 		KERNEL_UNLOCK_ALL(l, &l->l_biglocks);
 		sigclearall(p, &contsigmask, &kq);
+		mutex_enter(proc_lock);
 		p->p_waited = 0;
+		p->p_pptr->p_nstopchild++;
+		mutex_exit(proc_lock);
 		membar_producer();
 		p->p_stat = SSTOP;
 		lwp_lock(l);

	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index