This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to detect symbol interposition?


On 06/28/2016 07:56 PM, Mike Frysinger wrote:
On 28 Jun 2016 16:12, Florian Weimer wrote:
I need a way to detect symbol interposition from within libc.

why ?

I want to add a hardened variant of getline which uses malloc_usable_size to check chunk size and specified size for consistency.

Not all interposed mallocs interpose malloc_usable_size as well, so I need to check for

  (malloc == __libc_malloc)
    == (malloc_usable_size == _libc_malloc_usable_size)

and only do this if equality holds.

Another application is initialization for glibc malloc. To reduce the number of function pointers, I would like to remove the malloc hooks. But this means that we need to remove lazy initialization of malloc. I want to add an explicit call into malloc to perform basically what ptmalloc_init does today, but only if glibc malloc has not been interposed.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]