aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc_2.26.bb
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2017-09-05 12:29:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-11 17:30:10 +0100
commitf2e586ebf59a9b7d5b216fc92aeb892069a4b0c1 (patch)
tree8c65e2c9dc2261817b71788486c90ac031ff2851 /meta/recipes-core/glibc/glibc_2.26.bb
parent11350a67ba137f560d04aa643ff500a7ff112c73 (diff)
downloadopenembedded-core-contrib-f2e586ebf59a9b7d5b216fc92aeb892069a4b0c1.tar.gz
glibc: add ld.so locks in _libc_fork
The patch in this Bugzilla entry was requested by a customer: https://sourceware.org/bugzilla/show_bug.cgi?id=4578 https://www.sourceware.org/bugzilla/show_bug.cgi?id=19282 If a thread happens to hold dl_load_lock and have r_state set to RT_ADD or RT_DELETE at the time another thread calls fork(), then the child exit code from fork (in nptl/sysdeps/unix/sysv/linux/fork.c in our case) re-initializes dl_load_lock but does not restore r_state to RT_CONSISTENT. If the child subsequently requires ld.so functionality before calling exec(), then the assertion will fire. The patch acquires dl_load_lock on entry to fork() and releases it on exit from the parent path. The child path is initialized as currently done. This is essentially pthreads_atfork, but forced to be first because the acquisition of dl_load_lock must happen before malloc_atfork is active to avoid a deadlock. The __libc_fork() code reset dl_load_lock, but it also needed to reset dl_load_write_lock. Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-core/glibc/glibc_2.26.bb')
-rw-r--r--meta/recipes-core/glibc/glibc_2.26.bb2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc_2.26.bb b/meta/recipes-core/glibc/glibc_2.26.bb
index d453d8f9bf..135ec4fb16 100644
--- a/meta/recipes-core/glibc/glibc_2.26.bb
+++ b/meta/recipes-core/glibc/glibc_2.26.bb
@@ -41,6 +41,8 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \
file://0026-assert-Suppress-pedantic-warning-caused-by-statement.patch \
+ file://0027-glibc-reset-dl-load-write-lock-after-forking.patch \
+ file://0028-Bug-4578-add-ld.so-lock-while-fork.patch \
"
NATIVESDKFIXES ?= ""