Mercurial > hg > icedtea8-forest > jdk
changeset 12619:5dcb55da00c1 icedtea-3.6.0pre02
PR3479: ECC and NSS JVM crash
Summary: SunEC provider can have multiple instances, leading to premature NSS shutdown
Contributed-by: Martin Balao <mbalao@redhat.com>
author | andrew |
---|---|
date | Mon, 16 Oct 2017 23:47:52 +0100 |
parents | bf62c56e3604 |
children | 36d0aa03687e |
files | make/mapfiles/libsunec/mapfile-vers src/share/classes/sun/security/ec/SunEC.java src/share/native/sun/security/ec/ECC_JNI.cpp |
diffstat | 3 files changed, 3 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/make/mapfiles/libsunec/mapfile-vers Mon Jul 17 11:47:12 2017 +0200 +++ b/make/mapfiles/libsunec/mapfile-vers Mon Oct 16 23:47:52 2017 +0100 @@ -32,7 +32,6 @@ Java_sun_security_ec_ECDSASignature_verifySignedDigest; Java_sun_security_ec_ECDHKeyAgreement_deriveKey; Java_sun_security_ec_SunEC_initialize; - Java_sun_security_ec_SunEC_cleanup; local: *; };
--- a/src/share/classes/sun/security/ec/SunEC.java Mon Jul 17 11:47:12 2017 +0200 +++ b/src/share/classes/sun/security/ec/SunEC.java Mon Oct 16 23:47:52 2017 +0100 @@ -83,21 +83,8 @@ } /** - * Cleanup native resources during finalisation. - */ - @Override - protected void finalize() { - cleanup(); - } - - /** * Initialize the native code. */ private static native void initialize(); - /** - * Cleanup in the native layer. - */ - private static native void cleanup(); - }
--- a/src/share/native/sun/security/ec/ECC_JNI.cpp Mon Jul 17 11:47:12 2017 +0200 +++ b/src/share/native/sun/security/ec/ECC_JNI.cpp Mon Oct 16 23:47:52 2017 +0100 @@ -525,14 +525,12 @@ } JNIEXPORT void -JNICALL Java_sun_security_ec_SunEC_cleanup - (JNIEnv *env, jclass UNUSED(clazz)) +JNICALL JNI_OnUnload + (JavaVM *vm, void *reserved) { #ifdef SYSTEM_NSS RNG_RNGShutdown(); - if (SECOID_Shutdown() != SECSuccess) { - ThrowException(env, INTERNAL_ERROR); - } + SECOID_Shutdown(); #endif }