tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Proposal for handling alloca(). Anyone see a problem


From: David A. Wheeler
Subject: Re: [Tinycc-devel] Proposal for handling alloca(). Anyone see a problem with it?
Date: Mon, 07 May 2007 22:48:19 -0400 (EDT)

I said earlier:
> So maybe it's not so hard to implement alloca() traditionally... I'll need to 
> investigate how it interacts with the buffer-overflow detection stuff

After looking over the original papers about it, and the tcc code, doing the 
buffer-overflow stuff for alloca() looks pretty easy!

It appears that alloca() just needs to call __bound_new_region(void *p, 
unsigned long size).  Since alloca()'ed code may be an array, to make it work 
with bounds-checking, alloca should reserve at least one more byte (I'd reserve 
4 more bytes, for alignment).

I expected much more nastiness in the details, but I don't see any problems 
with it at all now.

Maybe alloca on-the-stack isn't so bad at all!  I'm going to give this a go, 
and see how it flies.  Thanks to all for your help.

--- David A. Wheeler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]