Subject: race conditions in swapin/swapout
To: None <tech-smp@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-smp
Date: 07/22/2002 16:03:27
Now I'm not sure if the 'biglock' stops these, but I noticed
that the process swapping code (ie un-wire U area) in uvm/uvm_glue.c
seems capable of some rather nasty actions, including:

- swapping the current process
- playing with zombies (and maybe invalid proc structures)

IMHO the following changes need to be made:

- put all of the code that looks at proc structures inside the
  proclist_lock_read() proclist_unlock_read() pair.
  (at least until P_INMEM is set)

- don't swap if p->p_stat == SONPROC

- recheck the process state after grabbing SCHED_LOCK.

Fixes aren't hard...

	David

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