From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34677 invoked by alias); 28 Dec 2018 22:26:06 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 34526 invoked by uid 89); 28 Dec 2018 22:26:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=accounting, threshold, binding, disabling X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: hall.aurel32.net Received: from hall.aurel32.net (HELO hall.aurel32.net) (163.172.24.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Dec 2018 22:26:03 +0000 Received: from [78.30.2.155] (helo=ohm.local) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gd0Zs-0007b9-Tt; Fri, 28 Dec 2018 23:26:01 +0100 Received: from aurel32 by ohm.local with local (Exim 4.91) (envelope-from ) id 1gd0Zl-0004mu-Q8; Fri, 28 Dec 2018 23:25:53 +0100 From: Aurelien Jarno To: libc-stable@sourceware.org Cc: Florian Weimer Subject: [2.24 COMMITTED 2/5] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636] Date: Mon, 01 Jan 2018 00:00:00 -0000 Message-Id: <20181228222540.18325-2-aurelien@aurel32.net> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181228222540.18325-1-aurelien@aurel32.net> References: <20181228222540.18325-1-aurelien@aurel32.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00030.txt.bz2 From: Florian Weimer Disabling lazy binding reduces stack usage during unwinding. Note that RTLD_NOW only makes a difference if libgcc.so has not already been loaded, so this is only a partial fix. Reviewed-by: Adhemerval Zanella (cherry picked from commit f993b8754080ac7572b692870e926d8b493db16c) --- ChangeLog | 6 ++++++ NEWS | 1 + sysdeps/nptl/unwind-forcedunwind.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7f37d678be..48292d6bf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-01-10 Florian Weimer + + [BZ #22636] + * sysdeps/nptl/unwind-forcedunwind.c (pthread_cancel_init): Open + libgcc.so with RTLD_NOW, to avoid lazy binding during unwind. + 2018-01-08 Szabolcs Nagy [BZ #22637] diff --git a/NEWS b/NEWS index f2e9b3bf9f..9a11b86b11 100644 --- a/NEWS +++ b/NEWS @@ -71,6 +71,7 @@ The following bugs are resolved with this release: [21609] x86-64: Align the stack in __tls_get_addr [21624] Unsafe alloca allows local attackers to alias stack and heap (CVE-2017-1000366) [21654] nss: Fix invalid cast in group merging + [22636] PTHREAD_STACK_MIN is too small on x86-64 [22637] nptl: Fix stack guard size accounting [22644] string: memmove-sse2-unaligned on 32bit x86 produces garbage when crossing 2GB threshold (CVE-2017-18269) diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c index ca757c48ce..24a1c5b30d 100644 --- a/sysdeps/nptl/unwind-forcedunwind.c +++ b/sysdeps/nptl/unwind-forcedunwind.c @@ -49,7 +49,7 @@ pthread_cancel_init (void) return; } - handle = __libc_dlopen (LIBGCC_S_SO); + handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN); if (handle == NULL || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL -- 2.19.2