diff options
author | kib <kib@FreeBSD.org> | 2016-03-21 06:52:35 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-03-21 06:52:35 +0000 |
commit | bdf946f966d7ddac003ce4228b156d1c35f7d8b2 (patch) | |
tree | 144ad6be72345b1199265c0c479ee3531a129f78 /lib/libthr/thread/thr_init.c | |
parent | 7c5b09c965362ccd47a76006eee82e838187e03d (diff) | |
download | FreeBSD-src-bdf946f966d7ddac003ce4228b156d1c35f7d8b2.zip FreeBSD-src-bdf946f966d7ddac003ce4228b156d1c35f7d8b2.tar.gz |
Lock pshared_lock shared around fork, to ensure that the COW snapshot
of the pshared hash in child is consistent and can be safely used.
Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com>
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index b0f4c5e..f9f845b 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -445,7 +445,6 @@ init_private(void) _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); - __thr_pshared_init(); _thr_wake_addr_init(); _sleepq_init(); _single_thread = NULL; @@ -456,6 +455,7 @@ init_private(void) * e.g. after a fork(). */ if (init_once == 0) { + __thr_pshared_init(); /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; |