Subject: race conditions in swapin/swapout
To: None <email@example.com>
From: David Laight <firstname.lastname@example.org>
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 Laight: email@example.com