classpath-patches
[Top][All Lists]
Advanced

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

RE: [cp-patches] Patch: java/lang/Runtime.java


From: Jeroen Frijters
Subject: RE: [cp-patches] Patch: java/lang/Runtime.java
Date: Tue, 7 Sep 2004 09:18:43 +0200

Mark Wielaard wrote:
> On Mon, 2004-09-06 at 17:07, Jeroen Frijters wrote:
> > > > BTW, does anyone know if (and how) a VM is supposed to 
> do a security
> > > > check when a native method is linked?
> > > 
> > > I thought the only check is done when a library is loaded (which
> > > contains the native methods).
> > 
> > Apparantly. This surprised me, because it means that the 
> decision is per
> > class loader instead of per individual class.
> 
> It is per VM even since JNI doesn't allow a given JNI native 
> library to be loaded by more than one class loader. (Because
> of "type safety in C code no less! We wouldn't want JNI code
> to cache its defining classloader and be surprized later that
> it is also linked against another class with the same [method]
> name from a different class loader...)

I know (I implemented this part of JNI recently). What I meant was the
security check, but I now realise that the attack that I thought about
isn't possible because each JNI method is prefixed by the class name, so
a malicious class cannot link to a native method of another class.

Regards,
Jeroen




reply via email to

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