Implement JVM_FindClassFromCaller OpenJDK: 8015256: Better class accessibility

#147 Declined
Repository
xranby
Branch
default
Repository
cacaovm
Branch
default
Author
  1. Xerxes Rånby
Reviewers
Description

The latest OpenJDK secuity update broke all alternative JVM support by introducing a new symbol JVM_FindClassFromCaller

http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2032

The OpenJDK source tree revealed the following information: 8015256: Better class accessibility Summary: Improve protection domain check in forName() http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/61d1e75e0a58 http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/16cd2826a58f

JVM_FindClassFromCaller appears to work quite similar to JVM_FindClassFromClassLoader with the twist that the protection domain that belongs to the caller class argument shall be used during the lookup of the class.

This implements JVM_FindClassFromCaller for cacao with this obvious TODO:

/* XXX The caller's protection domain should be used during
the load_class_from_classloader but there is no specification or
unit-test in OpenJDK documenting the desired effect */

java -cacao -version
java version "1.7.0_65"
IcedTea Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
CACAO (build 1.6.2pre+rea3c9a40d975, compiled mode)

Comments (1)

  1. Stefan Ring

    Thanks! I'm uneasy with including the javadoc parts because of legal issues. I will recreate the code parts though.