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] network: Fix cmsghdr padding in sendmsg (BZ#16919)



On 26/05/2016 13:27, Joseph Myers wrote:
> On Thu, 26 May 2016, Mike Frysinger wrote:
> 
>> i think it should do a length test -- if it's below a threshold, use
>> alloca, otherwise fall back to malloc+free.  inserting our own limit
>> here feels wrong.
> 
> sendmsg is required by POSIX to be AS-safe, so can't use malloc+free; it 
> would have to allocate memory in some other AS-safe way.

And I think introducing AS-safe allocation here adds a lot of complexity
and performance issues (even using mmap or pool buffer in some way).

I do fell it might be wrong to add an arbitrary limit here, however the
usage of control buffer in these syscalls is quite limited and passing
large buffers is unusual.  Also ENOMEM just instruct to use that it should
either send multiple messages or rework de application, which I fell it is
a tradeoff to implement the standard compliance fix.


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