From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26359 invoked from network); 31 Mar 2021 14:33:48 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 31 Mar 2021 14:33:48 -0000 Received: (qmail 23655 invoked by uid 550); 31 Mar 2021 14:33:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 23625 invoked from network); 31 Mar 2021 14:33:43 -0000 Date: Wed, 31 Mar 2021 10:33:31 -0400 From: Rich Felker To: Alexander Monakov Cc: musl@lists.openwall.com Message-ID: <20210331143330.GE25400@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] RELRO vs deferred binding On Wed, Mar 31, 2021 at 05:27:09PM +0300, Alexander Monakov wrote: > Hi, > > my understanding is that deferred binding currently does not work if any of the > deferred relocations fall into the RELRO segment. > > I am raising this because Alpine may try enabling -fno-plt globally, and > with -fno-plt non-PLT GOT relocations will be in RELRO, and affected Xorg > modules will fail to load, again, but now with a segfault in the dynamic > linker, presumably (I have not tested this). Thanks for raising this. I think deferred binding needs to be updated either to ignore RELRO if there are outstanding relocations (possibly deferring it until they are all resolved) or to unprotect and reprotect on every incremental link. (This could be optimized out and preserve some further safety by scanning the outstanding relocation table and skipping the unprotect/reprotect if none of them lie in the RELRO range.) Rich