This is the mail archive of the libc-alpha@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: [PATCH] posix: Call internal free on fallback p{read,write}v on Linux (BZ#22457)



On 23/11/2017 10:25, Florian Weimer wrote:
> On 11/23/2017 01:06 PM, Adhemerval Zanella wrote:
>> As described in BZ#22457 an interpose malloc can free an invalid
>> pointer for fallback preadv implementation.  Fortunately this is
>> just and issue on microblaze-linux-gnu running kernels older than
>> 3.15.
>>
>> This patch fixes it by calling internal free (__libc_free).  Another
>> possible option would be replace posix_memalign/free with a mmap/unmap,
>> however this is pessimization since it will two more syscalls necessary
>> for each preadv/pwritev call.
> 
> This will break static malloc interposition because some of the functions in malloc/malloc.o are not weak.
> 
> With an interposed malloc, the glibc malloc may not have been initialized, so you will have to supply your own locking here, too.
> 
> I think you should use mmap/munmap.

Sigh, so it basically means we can't use internal malloc symbol to
avoid interposition.  Right, mmap seems a better alternative for
this.


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