From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500c.mail.yandex.net (forward500c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d500]) by sourceware.org (Postfix) with ESMTPS id DDBBE3858CDB for ; Wed, 29 Mar 2023 14:20:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DDBBE3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5ba1:0:640:dcdc:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id EA5B55F625; Wed, 29 Mar 2023 17:20:27 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id PKJDCH3Wl8c0-LRGYzsmI; Wed, 29 Mar 2023 17:20:27 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1680099627; bh=sy5RudZ5loPVc+TITmqh0hkOOYa7sFiwtR201QTp14M=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=A7TkVmcqnQHtzjC2oLGGMIi9Oi6yfTdKl1L7l2DP+l7CPGKzslAwtFMiWgSBGflzx ooQYYZV353SSBH88t4LMaZKCpLwA1ogiU+uT1JSNIR57qsIWQZSjvxNJgc1qxsMvlt yT0ZITmfLs0UCQrgdX6VQTPxI2ZRFjfNVKmF4GIQ= Authentication-Results: mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Date: Wed, 29 Mar 2023 19:20:25 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 12/13] dlfcn,elf: implement dlmem() [BZ #11767] Content-Language: en-US To: Jonathon Anderson , Carlos O'Donell , libc-alpha@sourceware.org References: <20230318165110.3672749-1-stsp2@yandex.ru> <20230318165110.3672749-13-stsp2@yandex.ru> <3541bbd7-8a68-2064-bb63-2a921cfe3bb1@yandex.ru> <630fa17528c6050d60f524aa88ad5a057cae1603.camel@rice.edu> From: stsp In-Reply-To: <630fa17528c6050d60f524aa88ad5a057cae1603.camel@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A,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 List-Id: 29.03.2023 19:10, Jonathon Anderson пишет: > Stas, > > Please do some research into the ELF file format. Neither your fdlopen implementation in the test cases nor your dlopen_with_offset implementation in the email chain implement it correctly. > > AFAICT, the first glaring issue with both of your implementations is that you have neglected the case where p_offset != p_vaddr, i.e. a segment is mmapped to a different location than its layout in the file. There are a LOT of binaries out in the wild where this is the case. Here's a quick one-liner to help you find some on your own box, I have 11712 such binaries on my Debian system: Sure as hell p_offset != p_vaddr. I never ever assumed it does! OK, if it goes that badly, then I offer you a deal. If you present the solib with p_offset!=p_vaddr and demonstrate that its broken with dlmem(), and not because some random bug of mine but exactly because p_offset!=p_vaddr, then I go away from that dlmem() proposal forever. If you can't, then you go away. Do you accept that challenge? Sorry for offering the silly stuff, but I simply don't see how to proceed if we are wasting the time on a things like that.