Overriding malloc

Florian Weimer fweimer@redhat.com
Tue Jul 1 08:28:00 GMT 2014


We need to support overriding malloc through LD_PRELOAD and other forms 
of symbol interposition.  Once you override malloc, you also have to 
override free, realloc and calloc at least.

If the application (or one of its libraries) uses posix_memalign etc., 
these have to be overridden as well.  Same for the malloc_usable_size.

The question is if overriding those should is required even if the 
application does not call those fringe malloc-related functions, i.e. if 
glibc should behave as if it never calls them if malloc has been overridden.

If yes, we should likely remove the remaining call to malloc_usable_size 
from the code base.

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list