This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Compiler alternatives to no-exec (was Re: non exec stack...)


On 7 Aug 1998 06:20:07 GMT, Linus Torvalds (torvalds@transmeta.com) wrote:
>There's an even simpler fix, with the compiler just pushing 0 on entry
>to all functions, and on exit it pops it off and aborts if it is
>non-zero. 
>
>If somebody is using a overlong string, it cannot contain an all-zero
>value in the middle, so nobody can use the standard string overflow
>trick. 
>
>Zero also happens to be very cheap to test against. Total overhead: four
>instructions per function

And what about an optional warning in the compiler which would you inform
about all uses of hardcoded array bounds? This would incure at least no
cost in the executable at all and make the fixing of the offending broken
apps just a breeze... Maybe someone on egcs with some spare time should
consider this seriously?

			Marcin
=========================================================================
  In real life:         System Programmer at AIS AXON GmbH



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