From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id A4E433858C39; Thu, 16 Sep 2021 04:26:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4E433858C39 Received: by mail-pg1-x532.google.com with SMTP id k24so4944545pgh.8; Wed, 15 Sep 2021 21:26:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=COIKWwU+iVi6WUGmXj8iqYBR6xa1HV3kC47I8qWZ9Uo=; b=6VIa9m19PWX+4ZJeXUlPRwsl/alf1xTmx+xwODO+zST06TOQS7UXGxHVHtOWbRlgDc M+hp6DI638FAt4aSVPUZRvFB3dzjEYh31IuNqWcBKffe1OCQosE147E9IWHEDtw8EmEk xhpbfr2241gAcVGvxnVnZVnV0uyt45qxKaMgbpMwcrrJRM3ry03/Bg3ClGt21ol27a9s kZiEPqvT6vxoc3wnSJCoYIz/S/i7Rd2fX/JDB1yHiEN3LvpCRnQZgXEShOI5cQPBkqf6 2pfKvKfiNEm2zvu/0MmSWZcyGvfIht/CgA6rkXRhfh22IUqSAQ4/57zhPOtSi4yv4pOJ etOw== X-Gm-Message-State: AOAM5327DszJqmo1fGrMJEug/5SEKxKEKKgaJ6UUGQbPPVvzaHQ3S+Ul Sy6LQgnClEZdIf5Y3CNsSHoP6F75mxyHwJgYpNdxUVi2UpM= X-Google-Smtp-Source: ABdhPJwNXhBdwQ5DGYepBO+n5/a0aQDnmENkiJ2KkB1hVAtZggLBuEm6wjt5lKJPQtFouRRA4u/J8pLbI82gOp9QLG8= X-Received: by 2002:aa7:8201:0:b0:3fd:7dbd:fbbe with SMTP id k1-20020aa78201000000b003fd7dbdfbbemr3375193pfi.43.1631766398631; Wed, 15 Sep 2021 21:26:38 -0700 (PDT) MIME-Version: 1.0 References: <20210914190919.1728320-1-siddhesh@sourceware.org> <9d0f8dcc-35d4-d87a-b3b0-c006fdfe482f@sourceware.org> In-Reply-To: From: "H.J. Lu" Date: Wed, 15 Sep 2021 21:26:02 -0700 Message-ID: Subject: Re: [PATCH] ld.so: Handle read-only dynamic section gracefully [BZ #28340] To: Siddhesh Poyarekar Cc: Florian Weimer , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 04:26:40 -0000 On Wed, Sep 15, 2021 at 8:46 PM Siddhesh Poyarekar wrote: > > On 9/16/21 7:53 AM, H.J. Lu wrote: > >> What's the use case for read-only dynamic segments beyond VDSO? That > >> is, in what situations would one need to load an relocatable DSO (or > >> execute a PIE program) that has a read-only dynamic segment? On the > >> other hand for DSOs without relocations, in what situations do you see a > >> valid object having a read-only DYNAMIC segment? > > > > There is nothing wrong with read-only dynamic segment. > > Do you mean to say that the dynamic linker should always try to read > such DSOs correctly and, like the vdso, allocate a writable dynamic > array to work around the .dynamic section being read-only? > > I suppose if ld.so needs to handle it correctly, then it would also have > to read the flags of the LOAD segment that covers the DYNAMIC segment to > make sure that it has the right permission flags. What if DL_RO_DYN_SECTION is always 1? -- H.J.