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=DKIM_SIGNED,DKIM_VALID, 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 21978 invoked from network); 25 May 2020 17:27:08 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 25 May 2020 17:27:08 -0000 Received: (qmail 3278 invoked by uid 550); 25 May 2020 17:27:04 -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 3257 invoked from network); 25 May 2020 17:27:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell-sw-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Tm1QoVSKD+xyykkP5USeFEVEy4CYTJ+TfrbmFbmQkvU=; b=Zsa3B71Y3EUyF9rPcygza8ZFGunzAKtmWl0sQa9K2o6Oxdi/g5VmWJx4cPnIet0PC8 NMyzQxRorABaRZbfTDjzrEQFMf1hPMPg/xNuzSGv7S7g6DyWI5+Yd8G++0vB01OerSGo eFY8Vnu9/zf2eX9vLKAHOQ3VaHu3yzVptGzJ9WFHtc7z4dOu5OGVTK4zOrrnst8w/4WQ 9rMGYbKD4Tg+eUg2YH3iVUir9i0yPCtliQ8+VWa2HCEDHCr7/FV5c/bUaL79jjFzVIhl EwP3iFbqLPgGMLUL7job3za1mkRey/6TBkjan1zL0SEtIBit/UK4b+/JHNXNH/rCDWWq 3ROA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Tm1QoVSKD+xyykkP5USeFEVEy4CYTJ+TfrbmFbmQkvU=; b=pj6iUYYa5vBW50xJ+/2ROxs3iArP+k45x3hx+F4fTVEm42sNaRWTS+fbKCryxfs5au UwPJ8htNS6DNZ5w76NsjdmAcJH2zieDu9pMCRAaNiDXsDhn4euegxsrU/5WdwqzObogi OsuyT7IKG7XCoRn60IIo2yJmxwHnvWqXZRCi6f6G/gEN7+NkFhhOF2yo3Wx/ANqDOBgp ONxFwlKI9MqVyvNyXzZXeeFO9FngJmVcRHyGyLNSmCgNJV3/JwIS7KY6KNaQdkQWT3YM swwshhDbUV379pJjB2fGSjaI4MLxx5JPQL8Vv8RaoViaWfLVgAtL0JZyb1ivbHGP1UJQ gzjw== X-Gm-Message-State: AOAM531ZkHaxO2OgjMe+5GkFPjUVFkah1JBryUiJblRZ8bn3fYNo89MZ VFP+fwoDS00YGt9v5tm26P+RIw== X-Google-Smtp-Source: ABdhPJxrh+/VerEAf2n6OMKuRIe8lQaYSaHBK5lOHUZ14sYwOlawyGFhwjlYBIJdHIQsNqkbKHtuGA== X-Received: by 2002:a2e:3318:: with SMTP id d24mr11894436ljc.323.1590427612993; Mon, 25 May 2020 10:26:52 -0700 (PDT) To: Rich Felker Cc: musl@lists.openwall.com, Markus Wichmann References: <20200521152121.GA6521@voyager> <883535a2-1b26-183d-22f4-c3c158da2dbb@bell-sw.com> <20200522182555.GA1079@brightrain.aerifal.cx> From: Alexander Scherbatiy Message-ID: <96367f9c-4b02-c512-9d46-96de9e39a059@bell-sw.com> Date: Mon, 25 May 2020 20:26:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200522182555.GA1079@brightrain.aerifal.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [musl] Shared library loading On 22.05.2020 21:25, Rich Felker wrote: > The concept here is that non-pathname library names should be loaded > from the library path and not replaced by something (typically a > "module" or "plug-in") in a different, explicitly-loaded location that > happens to have a colliding base filename. > > For example suppose your application loads modules from $libdir/myapp/ > and has a module named "libfoo.so". Unbeknownst to you, there's also a > "libfoo.so" in the system paths, and some library you potentially load > indirectly (maybe the GPU driver for some video hardware you've never > heard of) depends on "libfoo.so". > > If dlopen("$libdir/myapp/libfoo.so") had put "libfoo.so" in the > namespace such that it would satisfy future load requests for the name > "libfoo.so", the subsequent load would break due to getting the wrong > (unrelated) library.   Is it correct that RTLD_GLOBAL flag is in some kind of obsolete in musl because calling     dlopen("$libdir/myapp/libfoo.so", RTLD_NOW | RTLD_GLOBAL);     dlopen("$libdir2/myapp2/libbar.so", RTLD_LAZY);    does not allow libbar.so to find library $libdir/myapp/libfoo.so which it is depend on?   What is the suggested way in musl to load $libdir/myapp/libfoo.so from a custom directory so libbar.so can find it? Thanks, Alexander. > Rich