From patchwork Wed Nov 27 20:30:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1201805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107464-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="I2hmpKoS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NXVb4T3lz9sPn for ; Thu, 28 Nov 2019 07:31:35 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=gkvb8StfqoLQTXMrjevzZQ6PDgKyFb5 J0HxyM2lqDhzl4pe1hQlfnVVOjeEU3+bjia53Q3kCTXqwxxGj1Lva9mb8BCgnMZn /KyLEfylEwtOUcXynJyDP9RwRqIj0sAeAHf9TbHJOZvUWNV46+s36Ume0F2hTNuC LbRpyzEUs/Mw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=ThKFZnG8t/G8rmLMyElMTpfMPSs=; b=I2hmp KoSPBQcN5qQCkfN8OuvFImNDafoMA/LwLy4Lj1/HqTJXbgBYgs70IjK9wWhTqCX8 soHDjeYAsNDyjs4HyKkJN9Apuc5ynfLKH7ARz2yDdPAFy682ZEP6TVDDWBFZFf1c 7+O+lLo+YuV/m6dQaLW9pv6jkYdJEj2Ftv1R7s= Received: (qmail 115850 invoked by alias); 27 Nov 2019 20:31:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115681 invoked by uid 89); 27 Nov 2019 20:30:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1985 X-HELO: mx1.osci.io X-Gerrit-PatchSet: 6 Date: Wed, 27 Nov 2019 15:30:50 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Cc: Carlos O'Donell Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] Move _dl_open_check to its original place in dl_open_worker X-Gerrit-Change-Id: I995a6cfb89f25d2b0cf5e606428c2a93eb48fc33 X-Gerrit-Change-Number: 473 X-Gerrit-ChangeURL: X-Gerrit-Commit: e37c2cf299b61ce18f62852f6c5624c27829b610 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, fweimer@redhat.com, libc-alpha@sourceware.org, carlos@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191127203050.0659620AF6@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/473 ...................................................................... Move _dl_open_check to its original place in dl_open_worker This reverts the non-test change from commit d0093c5cefb7f7a4143f ("Call _dl_open_check after relocation [BZ #24259]"), given that the underlying bug has been fixed properly in commit 61b74477fa7f63 ("Remove all loaded objects if dlopen fails, ignoring NODELETE [BZ #20839]"). Tested on x86-64-linux-gnu, with and without --enable-cet. Change-Id: I995a6cfb89f25d2b0cf5e606428c2a93eb48fc33 --- M elf/dl-open.c 1 file changed, 2 insertions(+), 6 deletions(-) Approvals: Carlos O'Donell: Looks good to me, approved diff --git a/elf/dl-open.c b/elf/dl-open.c index 1051e22..df9f29a 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -622,6 +622,8 @@ _dl_debug_state (); LIBC_PROBE (map_complete, 3, args->nsid, r, new); + _dl_open_check (new); + /* Print scope information. */ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) _dl_show_scope (new, 0); @@ -702,12 +704,6 @@ _dl_relocate_object (l, l->l_scope, reloc_mode, 0); } - /* NB: Workaround for [BZ #20839] which doesn't remove the NODELETE - object when _dl_open_check throws an exception. Move it after - relocation to avoid leaving the NODELETE object mapped without - relocation. */ - _dl_open_check (new); - /* This only performs the memory allocations. The actual update of the scopes happens below, after failure is impossible. */ resize_scopes (new);