From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12698 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: tcmalloc compatibility Date: Tue, 10 Apr 2018 23:17:24 +0200 Message-ID: <20180410211724.GJ4418@port70.net> References: <0ea267bf-ea3a-9810-be1a-50e71b6cfce1@denis.im> <20180410143359.GF3094@brightrain.aerifal.cx> <878t9vlzh1.fsf@mid.deneb.enyo.de> <20180410203354.GI4418@port70.net> <20180410204411.GK3094@brightrain.aerifal.cx> 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 1523394937 8007 195.159.176.226 (10 Apr 2018 21:15:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2018 21:15:37 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: Florian Weimer To: musl@lists.openwall.com Original-X-From: musl-return-12714-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 10 23:15:33 2018 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 1f60bx-0001uj-T3 for gllmg-musl@m.gmane.org; Tue, 10 Apr 2018 23:15:30 +0200 Original-Received: (qmail 29832 invoked by uid 550); 10 Apr 2018 21:17:37 -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 29811 invoked from network); 10 Apr 2018 21:17:36 -0000 Mail-Followup-To: musl@lists.openwall.com, Florian Weimer Content-Disposition: inline In-Reply-To: <20180410204411.GK3094@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12698 Archived-At: * Rich Felker [2018-04-10 16:44:11 -0400]: > On Tue, Apr 10, 2018 at 10:33:55PM +0200, Szabolcs Nagy wrote: > > - glibc dlsym calls calloc (bites anybody who tries to wrap > > calloc in the usual way) > > Yes. While I think it's unreasonable that glibc calls calloc from > dlsym, I also think it's unreasonable to be calling dlsym from a > malloc replacement. I don't think I would include dlsym or other > heavy, AS-unsafe functions in an allowed-list for musl. then the wrappers with dlsym(RTLD_NEXT,sym) would not work. (malloc checkers, valgrind, sanitizers etc all do it) in glibc there is __libc_calloc so you can get the address without dlsym, but in general you cannot wrap libc functions for instrumentation if dlsym is disallowed. i guess one could run dlsym early to initialize global pointers but then the interceptor still has to handle the case when it gets called before the appropriate dlsym is done, so users need to know what dlsym might call and how to do the initialization early enough.