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 27674 invoked from network); 5 Jan 2022 13:50:18 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 5 Jan 2022 13:50:18 -0000 Received: (qmail 9596 invoked by uid 550); 5 Jan 2022 13:50:12 -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 9568 invoked from network); 5 Jan 2022 13:50:11 -0000 Date: Wed, 5 Jan 2022 08:49:58 -0500 From: Rich Felker To: Florian Weimer Cc: Nihal Jere , musl@lists.openwall.com Message-ID: <20220105134957.GF7074@brightrain.aerifal.cx> References: <20220104214211.GC7074@brightrain.aerifal.cx> <8735m2ftmu.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8735m2ftmu.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Dynamic linker segfault On Wed, Jan 05, 2022 at 09:56:25AM +0100, Florian Weimer wrote: > * Rich Felker: > > > This is a malformed program file not compatible with the machine page > > size (4k). Arguably it should be detected as p_align < PAGESIZE -- in > > a sense, p_align for LOAD segments is the maximum supported page size > > for the program file, and machines not capable of providing a page > > size that small can't map/run it. In theory the loader could allow > > this if all the differences between segments satisfy the right > > congruences and have matching permissions where the maps would > > overlap, but I'm not sure that's useful. > > We've been looking at this on the glibc side recently. The use case is > supporting large data alignments (greater than the kernel page size) > while not pessimizing multi-page-size targets such as POWER and AArch64. I'm not clear how it pessimizes these targets (beyond what's fundamentally necessary) unless you're artificially aligning segment contents on disk to a large alignment boundary to prevent over-mapping (undermining separate-code for example). And if you're doing that, you need the full alignment anyway to support machines with larger hardware pagesize. Otherwise you'd get back the overmapping (and unwanted perission exposure). The only other thing I can think of is pessimizing ASLR by requiring more alignment (throwing away a few bits of position entropy). In any case, do you know if this test file is somehow related to that work, or is it just a guess? It doesn't seem to be related to me since it's essentially a "pageless" mapping setup. Rich