This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Security vulernarability or security feature?
- From: NightStrike <nightstrike at gmail dot com>
- To: "Robert C. Seacord" <rcs at cert dot org>
- Cc: "Ralph Loader" <suckfish at ihug dot co dot nz>, cert at cert dot org, crd at cert dot org, gcc at gnu dot org
- Date: Fri, 25 Apr 2008 12:09:51 -0400
- Subject: Re: Security vulernarability or security feature?
- References: <20080425085640.707e9a56@ihug.co.nz> <4810F65C.3090705@cert.org>
On 4/24/08, Robert C. Seacord <rcs@cert.org> wrote:
> If you are referring to VU#694123, this refers to an optimization that
> removes checks pointer arithmetic wrapping. The optimization doesn't
> actually eliminate the wrapping behavior; this still occurs. It does,
> however, eliminate certain kinds of checks (that depend upon undefined
> behavior).
How can you hold the compiler responsible for code that depends on
undefined behavior? The behavior is undefined, therefore you CANNOT
depend on it.
If you buy a hammer that says on it "for use in hammering nails," and
you use it to hammer in a screw, and it fails miserably (as hammering
screws is undefined behavior), is it the hammer manufacturer's fault
for not telling you about every single possible scenario in which a
hammer cannot be used?