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: Remove dynamic memory allocation from execl{e,p}


On Fri, 29 Jan 2016, Adhemerval Zanella wrote:

> My view is for such function is just try to allocate the buffer on
> stack and allow it fails through invalid access in case of buffer
> overflow.

I'd say just trying the allocation is OK in this case (if stack allocation 
is all that's permitted by the function semantics, and bearing in mind 
that current Linux versions determine ARG_MAX dynamically based on the 
stack limit) *if* it's allocated in a way that guarantees failure if it's 
too large (i.e. touching each page in turn) rather than potentially 
overflowing into unrelated memory.

-- 
Joseph S. Myers
joseph@codesourcery.com


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