mailing list of musl libc
 help / color / mirror / code / Atom feed
* Hijacking malloc called within musl libc
@ 2019-05-30 20:39 sva sva
  2019-05-30 22:29 ` Szabolcs Nagy
  0 siblings, 1 reply; 7+ messages in thread
From: sva sva @ 2019-05-30 20:39 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

I am LD_PRELOADing an application my own malloc which eventually calls the
libc malloc. Everything is fine until the code hits malloc which is called
from musl's own libc which doesn't get overloaded. I want those to be
overloaded as well.

More specifically this is the part of libc for scandir code at
src/dirent/scandir.c:
tmp = realloc(names, len * sizeof *names);

I checked how this works for glibc, and apparently they use
__libc_malloc/etc. internally and have malloc as a weak alias for that
which is used every where including the rest of the standard library.
However in musl, there is no such thing as a weak alias defined for
malloc/etc.

I am kind of stuck here so would appreciate some help.

Thanks

Vahid

[-- Attachment #2: Type: text/html, Size: 926 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-03 20:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30 20:39 Hijacking malloc called within musl libc sva sva
2019-05-30 22:29 ` Szabolcs Nagy
2019-05-31  4:13   ` sva sva
2019-05-31 11:43     ` Szabolcs Nagy
2019-05-31 13:34       ` Rich Felker
2019-06-03 18:46         ` sva sva
2019-06-03 20:18           ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).