[SSI] openssi/kernel/cluster/ssi/vproc pproc_subr.c,1.14,1.15

Roger Tsang <[email protected]> Wed, 16 Nov 2011 07:58:51 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc
In directory vz-cvs-3.sog:/tmp/cvs-serv5647/cluster/ssi/vproc

Modified Files:
      Tag: OPENSSI-FC
	pproc_subr.c 
Log Message:
pproc_getctty: fix OOPS dereferencing NULL pointer to signal_struct in task_struct; lost race with __exit_signal().
pproc_setctty: skip BKL; callers already hold BKL except for init process. (#ifdef PPROC_SETCTTY_SIGLOCK)


Index: pproc_subr.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/pproc_subr.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pproc_subr.c	25 Oct 2010 06:09:51 -0000	1.14
+++ pproc_subr.c	16 Nov 2011 07:58:49 -0000	1.15
@@ -125,7 +125,9 @@
 #else
 	SSI_ASSERT((flag & (VCTTY_SETCTTY|VCTTY_CLEARCTTY)) !=
 				(VCTTY_SETCTTY|VCTTY_CLEARCTTY));
-	lock_kernel(); /* protect tty_old_pgrp. see disassociate_ctty() */
+	/* SSI: Caller must hold BKL
+	 * to protect tty_old_pgrp. see disassociate_ctty()
+	 */
 #endif
 	task_lock(p);
 	if (flag & VCTTY_SETCTTY) {
@@ -144,9 +146,6 @@
 		}
 	}
 	task_unlock(p);
-#ifdef PPROC_SETCTTY_SIGLOCK
-	unlock_kernel();
-#endif
 
 	return 0;
 }
@@ -163,6 +162,7 @@
 /* Called with VPROC_HOLD_MOVEMENT */
 int pproc_getctty(struct task_struct *p, dev_t *cttydev, clusternode_t *cttynode)
 {
+	read_lock(&tasklist_lock);
 	if (p->signal) {
 		task_lock(p);
 		if (cttydev)
@@ -171,6 +171,7 @@
 			*cttynode = p->signal->cttynode;
 		task_unlock(p);
 	}
+	read_unlock(&tasklist_lock);
 
 	return 0;
 }


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1