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 Netto X-Patchwork-Id: 831575 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp2121069wrw; Mon, 30 Sep 2024 13:11:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwREqaLuWZabn/mFXP+TdjNES0kC5Wjm+tqBxnOV0j4oMD4dYCmC6HoW75Tg5cTNpNLVwKlA==@linaro.org X-Google-Smtp-Source: AGHT+IG+37fUCMB4kNL69vhFhzYA3AnaqPUNLnMy2WVOnCj0AxapEgC6BTEIPf/+anCwAAEUFMt+ X-Received: by 2002:a05:620a:45a2:b0:7a9:b4d2:9d68 with SMTP id af79cd13be357-7ae5b853bcamr159140785a.22.1727727071410; Mon, 30 Sep 2024 13:11:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727727071; cv=pass; d=google.com; s=arc-20240605; b=LKz+lWqk6YmIfH8Yg5ersnUU/4mteSkJIYHC7kFya2kTOL6R5diBXWGvYYB2uOoXdz ISqAme4AuHplOXs9X4tyI9W6UxXbAtPRIjaM37je+QlXlY7SE7Z+l537D5FZ3n/rKSYo K4QWqBQaUUhQFrkfUVFQhGd47aeKIakv/pi6ANxecSwE3resu8ohCIiQYjRku7NGih5i H/p7Sili/Rfl00Up7urgfTEHCX2Ly1rVcwXz8tLdJG3m6rfwE2IXyHJ+JZXA5v4Mja7O CO1B/OaItjiQAqevszP4fWFyyY7jGpOLex5shTuypS7TATWkv0wouvxGd+tF8uYMsjnd conQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=t4+HeD2Hzt1Y83nXACGjOB7d6ko6bhNwDhiOV2mE+EM=; fh=3tUIaab7WH3k5DYf15UFmY7vUQNGmrLDHVJFJrkNDfY=; b=Rk8CHT6fLSqRISzn5BfLlOdra3mt3OqvwEIbPxXMaIMCjm0BjpDtUyAc4BrVePCV4B ISneaRYGtvIv9KTeBYzKdtfgFU5QO8PkvZASvMj9AuzQIu33m/13BDLtBnkdPgRXdEQg EpoQgDkfwHj+ou2dgi7LZX3ESVi5fx4AgKXYPhgyqHIWKLqCDAo6IyETyPxF6DiecMft MFnV9ghm2LC/7aqcC3XRb50LE80hIg7eYpSDa9p49bf6lBCrepaXLNHZ85HvFLd0WHgG c2g9xwuDdNqyocbHG8caR7m5PzP29Pus8tuCJiboloe33WBoQJ8Lo9IQw8FNKHV7SQhX taZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0eOOmEe; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id af79cd13be357-7ae3787129fsi900594685a.555.2024.09.30.13.11.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0eOOmEe; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0265E3846402 for ; Mon, 30 Sep 2024 20:11:11 +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-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~patch=linaro.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);