blob: 71ddc1234b845c3b7c8b24223f2d3d2b054798c4 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From efb0fca7db742f4195e1771d8ba4c7fba4938819 Mon Sep 17 00:00:00 2001
Brad Bishop316dfdd2018-06-25 12:45:53 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 27 Jan 2018 10:05:07 -0800
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [PATCH] reset dl_load_write_lock after forking
Brad Bishop316dfdd2018-06-25 12:45:53 -04005
6The patch in this Bugzilla entry was requested by a customer:
7
8 https://www.sourceware.org/bugzilla/show_bug.cgi?id=19282
9
10The __libc_fork() code reset dl_load_lock, but it also needed to reset
11dl_load_write_lock. The patch has not yet been integrated upstream.
12
13Upstream-Status: Pending [ No Author See bugzilla]
14
15Signed-off-by: Damodar Sonone <damodar.sonone@kpit.com>
16Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 sysdeps/nptl/fork.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023index ec56a827eb..0f48933ff1 100644
Brad Bishop316dfdd2018-06-25 12:45:53 -040024--- a/sysdeps/nptl/fork.c
25+++ b/sysdeps/nptl/fork.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026@@ -130,9 +130,9 @@ __libc_fork (void)
Brad Bishop316dfdd2018-06-25 12:45:53 -040027 _IO_list_resetlock ();
28 }
29
30- /* Reset the lock the dynamic loader uses to protect its data. */
31+ /* Reset the locks the dynamic loader uses to protect its data. */
32 __rtld_lock_initialize (GL(dl_load_lock));
33-
34+ __rtld_lock_initialize (GL(dl_load_write_lock));
35 /* Run the handlers registered for the child. */
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036 __run_fork_handlers (atfork_run_child);
37 }