This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
How to detect symbol interposition?
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-help <libc-help at sourceware dot org>
- Date: Tue, 28 Jun 2016 16:12:11 +0200
- Subject: How to detect symbol interposition?
- Authentication-results: sourceware.org; auth=none
I need a way to detect symbol interposition from within libc.
It seems that this is not directly distinguishable from interposition
based on addresses alone:
#include <stdio.h>
#include <stdlib.h>
int
main (void)
{
printf ("main malloc: %p\n", malloc);
}
If I have a hidden alias of malloc within libc (say, __libc_malloc), so
that I can get the original address, it will be not equal to malloc
because malloc in the entire process will point to the PLT stub. The
PLT stub will call malloc, of course, but you cannot tell this from its
address.
Any suggestions?
Thanks,
Florian