/hg/icedtea6: PR2190: JamVM lacks JVM_FindClassFromCaller introd...
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Tue Mar 31 23:06:40 UTC 2015
changeset 26614f5e1108 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=26614f5e1108
author: Andrew John Hughes <gnu.andrew at redhat.com>
date: Wed Apr 01 00:06:27 2015 +0100
PR2190: JamVM lacks JVM_FindClassFromCaller introduced by security patch in 1.13.5
2015-01-07 Andrew John Hughes <gnu.andrew at member.fsf.org>
PR2190: JamVM lacks JVM_FindClassFromCaller introduced
by security patch in 1.13.5
* Makefile.am:
(ICEDTEA_PATCHES): Add new patch when building
JamVM.
(EXTRA_DIST): Include patches from JamVM directory.
* NEWS: Updated.
* patches/jamvm/pr2190-find_class_from_caller.patch:
Backport JamVM patch to implement FindClassFromCaller.
diffstat:
ChangeLog | 12 ++
Makefile.am | 5 +
patches/jamvm/pr2190-find_class_from_caller.patch | 93 +++++++++++++++++++++++
3 files changed, 110 insertions(+), 0 deletions(-)
diffs (131 lines):
diff -r cc9dd4878fae -r 26614f5e1108 ChangeLog
--- a/ChangeLog Thu Mar 26 17:26:21 2015 +0000
+++ b/ChangeLog Wed Apr 01 00:06:27 2015 +0100
@@ -1,3 +1,15 @@
+2015-01-07 Andrew John Hughes <gnu.andrew at member.fsf.org>
+
+ PR2190: JamVM lacks JVM_FindClassFromCaller introduced
+ by security patch in 1.13.5
+ * Makefile.am:
+ (ICEDTEA_PATCHES): Add new patch when building
+ JamVM.
+ (EXTRA_DIST): Include patches from JamVM directory.
+ * NEWS: Updated.
+ * patches/jamvm/pr2190-find_class_from_caller.patch:
+ Backport JamVM patch to implement FindClassFromCaller.
+
2015-03-26 Andrew John Hughes <gnu.andrew at redhat.com>
* NEWS:
diff -r cc9dd4878fae -r 26614f5e1108 Makefile.am
--- a/Makefile.am Thu Mar 26 17:26:21 2015 +0000
+++ b/Makefile.am Wed Apr 01 00:06:27 2015 +0100
@@ -654,6 +654,11 @@
patches/hotspot/hs23/systemtap-alloc-size-workaround.patch
endif
+if BUILD_JAMVM
+ICEDTEA_PATCHES += \
+ patches/jamvm/pr2190-find_class_from_caller.patch
+endif
+
if ENABLE_NSS
ICEDTEA_PATCHES += patches/rh1022017.patch
NSS_PATCHES = patches/nss-config.patch
diff -r cc9dd4878fae -r 26614f5e1108 patches/jamvm/pr2190-find_class_from_caller.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jamvm/pr2190-find_class_from_caller.patch Wed Apr 01 00:06:27 2015 +0100
@@ -0,0 +1,93 @@
+diff -Nru jamvm.old/src/classlib/openjdk/class.c jamvm/src/classlib/openjdk/class.c
+--- jamvm/jamvm.old/src/classlib/openjdk/class.c 2013-11-18 03:45:44.000000000 +0000
++++ jamvm/jamvm/src/classlib/openjdk/class.c 2015-01-07 16:14:57.599311159 +0000
+@@ -23,6 +23,7 @@
+ #include "jam.h"
+ #include "hash.h"
+ #include "class.h"
++#include "excep.h"
+ #include "symbol.h"
+
+ /* Cached offset of classes field in java.lang.ClassLoader objects */
+@@ -161,3 +162,24 @@
+
+ return strcat(strcpy(endorsed_dirs, java_home), "/lib/endorsed");
+ }
++
++Class *findClassFromLoader(char *name, int init, Object *loader,
++ int throw_error) {
++
++ Class *class = findClassFromClassLoader(name, loader);
++
++ if(class == NULL) {
++ if(!throw_error) {
++ Object *excep = exceptionOccurred();
++ char *dot_name = slash2DotsDup(name);
++
++ clearException();
++ signalChainedException(java_lang_ClassNotFoundException,
++ dot_name, excep);
++ sysFree(dot_name);
++ }
++ } else if(init)
++ initClass(class);
++
++ return class;
++}
+diff -Nru jamvm.old/src/classlib/openjdk/jvm.c jamvm/src/classlib/openjdk/jvm.c
+--- jamvm/jamvm.old/src/classlib/openjdk/jvm.c 2013-11-18 03:45:44.000000000 +0000
++++ jamvm/jamvm/src/classlib/openjdk/jvm.c 2015-01-07 16:16:43.560605105 +0000
+@@ -520,26 +520,22 @@
+ jclass JVM_FindClassFromClassLoader(JNIEnv *env, const char *name,
+ jboolean init, jobject loader,
+ jboolean throw_error) {
+- Class *class;
+
+ TRACE("JVM_FindClassFromClassLoader(env=%p, name=%s, init=%d, loader=%p,"
+ " throwError=%d)", env, name, init, loader, throwError);
+
+- class = findClassFromClassLoader((char *)name, loader);
++ return findClassFromLoader((char *)name, init, loader, throw_error);
++}
++
++/* JVM_FindClassFromCaller */
++
++jclass JVM_FindClassFromCaller(JNIEnv *env, const char *name, jboolean init,
++ jobject loader, jclass caller) {
+
+- if(class == NULL && !throw_error) {
+- Object *excep = exceptionOccurred();
+- char *dot_name = slash2DotsDup((char*)name);
+-
+- clearException();
+- signalChainedException(java_lang_ClassNotFoundException,
+- dot_name, excep);
+- sysFree(dot_name);
+- } else
+- if(init)
+- initClass(class);
++ TRACE("JVM_FindClassFromCaller(env=%p, name=%s, init=%d, loader=%p,"
++ " caller=%p)", env, name, init, loader, caller);
+
+- return class;
++ return findClassFromLoader((char *)name, init, loader, FALSE);
+ }
+
+
+diff -Nru jamvm.old/src/classlib/openjdk/openjdk.h jamvm/src/classlib/openjdk/openjdk.h
+--- jamvm/jamvm.old/src/classlib/openjdk/openjdk.h 2013-11-18 03:45:44.000000000 +0000
++++ jamvm/jamvm/src/classlib/openjdk/openjdk.h 2015-01-07 16:14:57.599311159 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (C) 2010, 2011, 2013 Robert Lougher <rob at jamvm.org.uk>.
++ * Copyright (C) 2010, 2011, 2013, 2014 Robert Lougher <rob at jamvm.org.uk>.
+ *
+ * This file is part of JamVM.
+ *
+@@ -53,3 +53,6 @@
+ extern Object *resolveMemberName(Class *mh_class, Object *mname);
+
+ extern Object *getMethodParameters(Object *method);
++
++extern Class *findClassFromLoader(char *name, int init, Object *loader,
++ int throw_error);
More information about the distro-pkg-dev
mailing list