git: kernel - Fix a SMP race between pageout and exec_new_vmspace()
Matthew Dillon
dillon at crater.dragonflybsd.org
Mon Oct 21 11:23:43 PDT 2013
commit 381893162d4a19ee2bebf252f7801d5016140cf8
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Mon Oct 21 10:17:12 2013 -0700
kernel - Fix a SMP race between pageout and exec_new_vmspace()
* Panics on token mismatch due to p->p_vmspace being replaced out
from under a process utilizing p->p_vmspace->vm_map.map_token.
* Fix a SMP race between pageout and exec_new_vmspace(). The pageout
code properly PHOLD()s the process and related process token but
fails to hold p->p_vmspace during a potentially blocking call.
Thus it is still possible to race termination of the vmspace and/or
for the process to replace its vmspace while the pageout activity is
in progress.
* Use vmspace_hold()/vmspace_drop() and reference the vmspace directly
after load it from p->p_vmspace. The race is allowed, but the vmspace
will no longer be destroyed out from under the pageout and the code
will no longer attempt to release the wrong token.
Summary of changes:
sys/vm/vm_pageout.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/381893162d4a19ee2bebf252f7801d5016140cf8
--
DragonFly BSD source repository
More information about the Commits
mailing list