race conditions in swapin/swapout

David Laight <[email protected]>
Newsgroups gmane.os.netbsd.devel.smp
Message-ID <[email protected]>
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: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.