This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: dewar at gnat dot com
- To: dewar at gnat dot com, jbuck at synopsys dot COM
- Cc: gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org,linuxppc-dev at lists dot linuxppc dot org, paulus at samba dot org,trini at kernel dot crashing dot org, velco at fadata dot bg
- Date: Wed, 2 Jan 2002 19:12:41 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<This is a modification to gcc that implements pointers as triples.
While there is a performance penalty for doing this, it can completely
eliminate the problem of exploitable buffer overflows. However, programs
that violate the rules of ISO C by generating out-of-range pointers will
fail.
>>
Note incidentally that the C rules that allow referencing the address just
past the end of an array (an irregularity that recognizes the infeasibility
of declaring the common idiom for (a=b;a<&b[10];a++)) has an interesting
consequence on a segmented machine, namely that you cannot allocate an
array too near the end of the segment.