From patchwork Mon Sep 30 20:08:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1991179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=R0eOOmEe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XHXJq5Pzhz1xsc for ; Tue, 1 Oct 2024 06:11:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F3053845146 for ; Mon, 30 Sep 2024 20:11:21 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 121533846425 for ; Mon, 30 Sep 2024 20:08:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 121533846425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 121533846425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727726934; cv=none; b=xXkY+9ouEcEp0W0DnqOBqatDWcowAm5h0bSKOkHZBh9fVE0Lgnsd4xai4e5ffz3j+U0rJnAus2mxfglqLDvWG76DeDLF82gxOxkywje/XA80zYuV4yNJ2VyUUsYvCrPW+KdHVt9Is3d4GHwaXwTptKu0FI5IfE3aFH2+SP2IYPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727726934; c=relaxed/simple; bh=YIrWpcQQtzFlYPXkOZQWo4zr2DGImdZXfwnpfDLSZ6s=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ebBDqABzwGoQF81UuPnDju+n6G9m+CZ2Pe/wFINpHhxGAZqTqLClTWW9cM6UP840txonHLX7UgQnArKACiZgMGxjAxUyEaCM4QL0cf2l8rre6nX4Q3wSsdTLfvlLBQWkmqJPcRAvjzliVI7s0Pjulk5rqnWvUM4MCPfxtw1s8LU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20b01da232aso34052115ad.1 for ; Mon, 30 Sep 2024 13:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727726932; x=1728331732; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t4+HeD2Hzt1Y83nXACGjOB7d6ko6bhNwDhiOV2mE+EM=; b=R0eOOmEeXwamRKiW3THtStn+3GqRu7KBxCyk5S098g8DQmLw6QXrUTBROKXNA1hE8q FS8UayfBPzeqY3984ReUbzlsOXPQfw3IjHP3WM3WOzIAFblakUEBFAykOVFUf8nATitR zr6Wgo0RpU2Bth5BSmXCcvC8yL6WWkvUedXj/cUW70CJkqZ+RR1cwtsYcEaBCzFcDLFX ME364OiD0wZhMxVDfUd3gB3pf3BMXcDOJux/WuN0pzkz1l+6MjDhrgUSJqNNyOXdlLYf mtS6Gu48qyXd2rYS5ZIfubht6yNMePeNuDnU6T5HtJZ09jM00N80R3MxZGTuZtK8k1an qrRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727726932; x=1728331732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t4+HeD2Hzt1Y83nXACGjOB7d6ko6bhNwDhiOV2mE+EM=; b=JtRTBVBaswBJLQT0kcG2P5M3oC+k9pyUqz73TcLjA/KgMHKGIDS8NeTr8EiOJGPP/p IeyI7iToTa78xQhY9//sbxSNVIfScE2I0SK7Lzkogi6GHeqKtJJXWa1Jvm9euCIcGwIb mBtNNUrQ3Hr1Kst8C31ecSWQD7pjjFMFC7WUPP0CJ/HalMvOX4yi8sSz7lQ/y/DjPsHp ra1zTvE5Q4HnGAbioWoP/rYIykaqFgcwZw0tY/6RHZdN6idOilQzLDb61NA6qraVEtJd Lw+fHWrGjc0mj9qaepBpppuRlqHpMoum+7+pdIdIaJ3x4QtR6qVQD6ILIaRm8m4h1Nfr qUiw== X-Gm-Message-State: AOJu0Yy0E8S1+X2dMncV3cZjWH2XSSzKoe89ZCyXFJ5MAGOj+0ftXzBH pahe45+kDL0uOyS7BYfFKFDxZYFWObPzOHStE5EMgKqc/FznektgX0UQaKhBc8lEHR7EqIgq1iv S6Cs= X-Google-Smtp-Source: AGHT+IFIn9USjvSNGzKwqmfw/ft/IAEz/HhU63XsAMJjTwx1FNhBVp1FyuOBBYoc/dINjXr6hN/jfg== X-Received: by 2002:a17:902:c947:b0:20a:fd4e:fef6 with SMTP id d9443c01a7336-20ba9ebb492mr11123745ad.8.1727726931719; Mon, 30 Sep 2024 13:08:51 -0700 (PDT) Received: from ubuntu-vm.. (201-92-183-102.dsl.telesp.net.br. [201.92.183.102]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2c4845sm6869565a12.43.2024.09.30.13.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:08:51 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Stephen Roettger , Jeff Xu , Florian Weimer , Mike Hommey , Adhemerval Zanella Subject: [PATCH v3 4/9] rtld: Move call_init_paths after _dl_process_pt_gnu_property Date: Mon, 30 Sep 2024 17:08:26 -0300 Message-Id: <20240930200831.1669010-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930200831.1669010-1-adhemerval.zanella@linaro.org> References: <20240930200831.1669010-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org To allow the loader malloc behavior to be changed by the gnu attribute. It would allow the pages allocated to be memory sealed if the loader if built with memory sealing. Checked on x86_64-linux-gnu. --- elf/rtld.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/elf/rtld.c b/elf/rtld.c index 8dfa089f83..0f4b3e9a43 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1708,10 +1708,6 @@ dl_main (const ElfW(Phdr) *phdr, /* With vDSO setup we can initialize the function pointers. */ setup_vdso_pointers (); - /* Initialize the data structures for the search paths for shared - objects. */ - call_init_paths (&state); - /* Initialize _r_debug_extended. */ struct r_debug *r = _dl_debug_initialize (GL(dl_rtld_map).l_addr, LM_ID_BASE); @@ -1767,6 +1763,10 @@ dl_main (const ElfW(Phdr) *phdr, /* Assign a module ID. Do this before loading any audit modules. */ _dl_assign_tls_modid (&GL(dl_rtld_map)); + /* Initialize the data structures for the search paths for shared + objects. */ + call_init_paths (&state); + audit_list_add_dynamic_tag (&state.audit_list, main_map, DT_AUDIT); audit_list_add_dynamic_tag (&state.audit_list, main_map, DT_DEPAUDIT);