How to detect symbol interposition?

Florian Weimer fweimer@redhat.com
Wed Jun 29 05:13:00 GMT 2016


On 06/29/2016 04:31 AM, Mike Frysinger wrote:
> On 28 Jun 2016 20:01, Florian Weimer wrote:
>> 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.
>
> just getline ?  or that's just where you want to start ?

getdelim too.  But there are few interfaces which take a pointer/size 
pair, and which must be called in such a way that the pointer, if it is 
not null, must point to the beginning of a heap allocation.

> i guess this kind of tails into the other discussion about how we don't
> document interposing memory symbols and how today, you can't just replace
> a single one and have it work.  and how sometimes you can get away with
> just a few, but in reality if you don't do them all, bad things happen.

It's not just about documentation, existing mallocs out there are 
inconsistent today, so we need to cope somehow.

Thanks,
Florian



More information about the Libc-help mailing list