From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10712 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] fix ldso reserved library name handling Date: Mon, 7 Nov 2016 12:03:23 -0500 Message-ID: <20161107170323.GE1555@brightrain.aerifal.cx> References: <20161101014909.GF5749@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1478538268 14993 195.159.176.226 (7 Nov 2016 17:04:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2016 17:04:28 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10725-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 07 18:04:20 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1c3nKi-0007i6-Eo for gllmg-musl@m.gmane.org; Mon, 07 Nov 2016 18:03:44 +0100 Original-Received: (qmail 26601 invoked by uid 550); 7 Nov 2016 17:03:45 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26508 invoked from network); 7 Nov 2016 17:03:39 -0000 Content-Disposition: inline In-Reply-To: <20161101014909.GF5749@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10712 Archived-At: On Tue, Nov 01, 2016 at 02:49:09AM +0100, Szabolcs Nagy wrote: > If a DT_NEEDED entry was the prefix of a reserved library name > (up to the first dot) then it was incorrectly treated as a libc > reserved name. > > e.g. libp.so dependency was not loaded as it matched libpthread > reserved name. > --- > > this is not the smallest possible patch (most of the diff is > indentation change), but i found the code cleaner without > the z and l-3 computation. > > ldso/dynlink.c | 38 +++++++++++++++++++------------------- > 1 file changed, 19 insertions(+), 19 deletions(-) The existing code was obviously wrong and this seems to work with simple testing (dlopen of reserved names still yields self pointer, dlopen of nonexistent prefixes fails) so I'm committing it. Thanks. Rich