From bdf946f966d7ddac003ce4228b156d1c35f7d8b2 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 21 Mar 2016 06:52:35 +0000 Subject: 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" Sponsored by: The FreeBSD Foundation --- lib/libthr/thread/thr_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libthr/thread/thr_init.c') 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; -- cgit v1.1