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: alloca avoidance patches


On 06/19/2017 10:47 AM, Joseph Myers wrote:
> It seems to me that we need a clear definition of what stack frame size 
> glibc can assume is safe (so that we can aim to eliminate alloca and VLAs 
> unless the compiler can see they are bounded, and use -Wstack-usage= for 
> building glibc to make sure no function uses too much stack).
> 
What we were thinking was a new -fstack-check implementation that
properly probes to avoid these problems (the existing -fstack-check is
fatally flawed for this stuff).

I've just posted an RFC around this issue to gcc-patches.  I've actually
got code here that can be used to protect x86, ppc, s390 and aarch64
from this class of problems.

I'm pretty happy with the x86 and ppc specific bits.  Less so with
aarch64 and s390.  Michael Matz has some ideas on generic checking
that's less efficient, but easy to drop into the other target code
generators.

Jeff


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