This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
safety of GCJ-generated code
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 17:53:22 +0000 (GMT)
- Subject: safety of GCJ-generated code
- References: <863d29spzo.fsf@megacz.com>
Adam Megacz writes:
>
> Is GCJ-compiled code "safe" in the sense that no malicious input to a
> program can possibly cause it to crash or jump to memory locations
> that aren't part of its code? (ie buffer overflows, stack-busting). By
> crash, I mean something beyond an uncaught exception.
By design, yes. But we can't promise perfection, and neither can any
Java VM.
> I know that normal JVMs have this property; and from my understanding
> of GCJ, I believe that it does as well (assuming that you leave
> bounds-checking turned on).
>
> I guess if I wanted to be really precise, I ought to say "assuming
> that the JVM/compiler/libgcj has no bugs, no matter how bug-ridden the
> java code being compiled is, it will never behave in an unsafe manner".
Right. But we're not perfect, and some components -- like the
verifier -- are rather new.
Andrew.