diff --git a/backport-fix-pthread_create-and-dlopen-racing.patch b/backport-fix-pthread_create-and-dlopen-racing.patch new file mode 100644 index 0000000000000000000000000000000000000000..94a421f2ea589544c695fe3e7c36a285b300a439 --- /dev/null +++ b/backport-fix-pthread_create-and-dlopen-racing.patch @@ -0,0 +1,40 @@ +From 4204b32bffc28772b7d026964f7ca325b00f7609 Mon Sep 17 00:00:00 2001 +From: xujing +Date: Thu, 2 Dec 2021 11:53:30 +0800 +Subject: [PATCH] fix pthread_create and dlopen racing. + +reason: fix pthread_create and dlopen racing. +--- + elf/dl-tls.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/elf/dl-tls.c b/elf/dl-tls.c +index c87caf13..1840f122 100644 +--- a/elf/dl-tls.c ++++ b/elf/dl-tls.c +@@ -478,7 +478,8 @@ _dl_allocate_tls_init (void *result) + + /* Keep track of the maximum generation number. This might + not be the generation counter. */ +- assert (listp->slotinfo[cnt].gen <= GL(dl_tls_generation)); ++ if (listp->slotinfo[cnt].gen > GL(dl_tls_generation)) ++ _dl_printf("warning: listp->slotinfo[cnt].gen > GL(dl_tls_generation) !\n"); + maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); + + dtv[map->l_tls_modid].pointer.val = TLS_DTV_UNALLOCATED; +@@ -514,7 +515,11 @@ _dl_allocate_tls_init (void *result) + break; + + listp = listp->next; +- assert (listp != NULL); ++ if (listp == NULL) ++ { ++ _dl_printf("warning: listp == NULL !\n"); ++ break; ++ } + } + + /* The DTV version is up-to-date now. */ +-- +2.23.0 + diff --git a/glibc.spec b/glibc.spec index b1f972158cbca7454e789f28a378a62c6e717758..88257b21bbaf1ee978656aa3a997f3024fdd1e61 100644 --- a/glibc.spec +++ b/glibc.spec @@ -59,7 +59,7 @@ ############################################################################## Name: glibc Version: 2.28 -Release: 81 +Release: 82 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -140,6 +140,7 @@ Patch56: backport-rtld-copy-terminating-null-in-tunables_strdup-bug-28.patch Patch57: backport-gconv-Do-not-emit-spurious-NUL-character-in-ISO-2022.patch Patch58: backport-nss-make-sure-startp_initialized-do-first.patch Patch59: backport-glibc-fix-CVE-2019-1010023.patch +Patch60: backport-fix-pthread_create-and-dlopen-racing.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1164,6 +1165,9 @@ fi %doc hesiod/README.hesiod %changelog +* Thu Dec 2 2021 xujing - 2.28-82 +- elf: fix pthread_create and dlopen racing + * Thu Dec 2 2021 xujing - 2.28-81 - glibc: fix CVE-2019-1010023