Message ID | 901e4c1a17ffbec769b9c891e3781ccde238ad6c.1688741159.git.fweimer@redhat.com |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56F313838BE7 for <patchwork@sourceware.org>; Fri, 7 Jul 2023 18:50:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56F313838BE7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688755827; bh=YSIHpX7VxFemRxe+xVuQAg+NpbXeCXa6xuGLbwBQWNo=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jdlSBr6tV+Rg6p3x0usqgEpOHOrUvHfeo3v74KK9lxEkppBmAJo2kAD9TE+FaKIJO iAB50XA0OssQ/jyExILS3ztGq7g70RIjzP9AcIkdyhIKfxBzHWmAY9Wtg4VIAuHadO HAB0rSBHqXJuGCuYXpKkxD7/Xz0nCa6fya2VuWOU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3F6973848169 for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:48:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F6973848169 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-UMEiUB50Pti5ek_igJRa6Q-1; Fri, 07 Jul 2023 14:48:26 -0400 X-MC-Unique: UMEiUB50Pti5ek_igJRa6Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5EC4830EFC for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:48:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 822DF40C206F for <libc-alpha@sourceware.org>; Fri, 7 Jul 2023 18:48:25 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v2 12/32] elf: Move __rtld_malloc_init_stubs call into _dl_start_final In-Reply-To: <cover.1688741159.git.fweimer@redhat.com> Message-ID: <901e4c1a17ffbec769b9c891e3781ccde238ad6c.1688741159.git.fweimer@redhat.com> References: <cover.1688741159.git.fweimer@redhat.com> X-From-Line: 901e4c1a17ffbec769b9c891e3781ccde238ad6c Mon Sep 17 00:00:00 2001 Date: Fri, 07 Jul 2023 20:48:23 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Florian Weimer <fweimer@redhat.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
RELRO link maps
|
|
Checks
Context | Check | Description |
---|---|---|
redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Florian Weimer
July 7, 2023, 6:48 p.m. UTC
Calling an extern function in a different translation unit before self-relocation is brittle. The compiler may load the address at an earlier point in _dl_start, before self-relocation. In _dl_start_final, the call is behidn a compiler barrier, so this cannot happen. --- elf/rtld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/elf/rtld.c b/elf/rtld.c index 54a7ade886..4624d99570 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -452,6 +452,8 @@ _dl_start_final (void *arg, struct dl_start_final_info *info) { ElfW(Addr) start_addr; + __rtld_malloc_init_stubs (); + /* Do not use an initializer for these members because it would interfere with __rtld_static_init. */ GLRO (dl_find_object) = &_dl_find_object; @@ -575,8 +577,6 @@ _dl_start (void *arg) function, that way the compiler cannot put accesses to the GOT before ELF_DYNAMIC_RELOCATE. */ - __rtld_malloc_init_stubs (); - #ifdef DONT_USE_BOOTSTRAP_MAP return _dl_start_final (arg); #else