Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in NativeCrypto.DigestUpdate (openssl native) #4530

Open
pshipton opened this issue Jan 31, 2019 · 13 comments

Comments

@pshipton
Copy link
Contributor

commented Jan 31, 2019

3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at jdk/crypto/jniprovider/NativeCrypto.DigestUpdate(Native Method)
4XESTACKTRACE                at sun/security/provider/NativeDigest.engineUpdate(NativeDigest.java:103)
4XESTACKTRACE                at java/security/MessageDigest$Delegate.engineUpdate(MessageDigest.java:613)
4XESTACKTRACE                at java/security/MessageDigest.update(MessageDigest.java:355)
4XESTACKTRACE                at com/sun/crypto/provider/HmacCore.engineUpdate(HmacCore.java:180)
4XESTACKTRACE                at javax/crypto/Mac.update(Mac.java:505)
4XESTACKTRACE                at sun/security/ssl/Authenticator$MacImpl.compute(Authenticator.java:510)
4XESTACKTRACE                at sun/security/ssl/Authenticator$TLS10Mac.compute(Authenticator.java:581)
4XESTACKTRACE                at sun/security/ssl/Authenticator$MAC.compute(Authenticator.java:444)
4XESTACKTRACE                at sun/security/ssl/SSLCipher.addMac(SSLCipher.java:2089)
4XESTACKTRACE                at sun/security/ssl/SSLCipher$T11BlockWriteCipherGenerator$BlockWriteCipher.encrypt(SSLCipher.java:1449)
4XESTACKTRACE                at sun/security/ssl/OutputRecord.t10Encrypt(OutputRecord.java:462)
4XESTACKTRACE                at sun/security/ssl/OutputRecord.encrypt(OutputRecord.java:394)
4XESTACKTRACE                at sun/security/ssl/SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:78)
5XESTACKTRACE                   (entered lock: sun/security/ssl/SSLSocketOutputRecord@0x00000000C0C0EDE8, entry count: 2)
4XESTACKTRACE                at sun/security/ssl/TransportContext.warning(TransportContext.java:243)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:553)
5XESTACKTRACE                   (entered lock: sun/security/ssl/SSLSocketOutputRecord@0x00000000C0C0EDE8, entry count: 1)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.close(SSLSocketImpl.java:479)
4XESTACKTRACE                at sun/security/ssl/BaseSSLSocketImpl.finalize(BaseSSLSocketImpl.java:275)
4XESTACKTRACE                at java/lang/J9VMInternals.runFinalize(J9VMInternals.java:328)

@pshipton pshipton changed the title Crash in NativeCrypto.DigestUpdate Crash in NativeCrypto.DigestUpdate (openssl native) Feb 1, 2019

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented Feb 1, 2019

The workaround for this is to disable the openssl digest support.
-Djdk.nativeDigest=false

pshipton added a commit to pshipton/openj9 that referenced this issue Feb 1, 2019
Update CryptoTest.java to load CipherCore
MessageDigest openssl support is being disabled due to eclipse#4530, the test
needs to check a different algorithm.

ibmruntimes/openj9-openjdk-jdk11#117
ibmruntimes/openj9-openjdk-jdk8#259

[ci skip]

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
pshipton added a commit to pshipton/openj9 that referenced this issue Feb 3, 2019
Update CryptoTest.java to load CipherCore
MessageDigest openssl support is being disabled due to eclipse#4530, the test
needs to check a different algorithm.

ibmruntimes/openj9-openjdk-jdk11#117
ibmruntimes/openj9-openjdk-jdk8#259

[ci skip]

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>

@pshipton pshipton added this to the Release 0.12.1 milestone Feb 3, 2019

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented Feb 3, 2019

Fixes are merged.

@pshipton pshipton closed this Feb 3, 2019

SueChaplain added a commit to SueChaplain/openj9-docs that referenced this issue Feb 4, 2019
Add warning to version 0.12.0 topic
Following the identification of issue
eclipse/openj9#4530,
updated the content to warn users that
the Digest algorithm might cause a problem
with this release.

Signed-off-by: Sue Chaplain <sue_chaplain@uk.ibm.com>
SueChaplain added a commit to SueChaplain/openj9-docs that referenced this issue Feb 4, 2019
Add warning to version 0.12.0 topic
Following the identification of issue
eclipse/openj9#4530,
updated the content to warn users that
the Digest algorithm might cause a problem
with this release.

Signed-off-by: Sue Chaplain <sue_chaplain@uk.ibm.com>
SueChaplain added a commit to SueChaplain/openj9-docs that referenced this issue Feb 4, 2019
Add warning to version 0.12.0 topic
Following the identification of issue
eclipse/openj9#4530,
updated the content to warn users that
the Digest algorithm might cause a problem
with this release.

Signed-off-by: Sue Chaplain <sue_chaplain@uk.ibm.com>
@ibm-rtvs

This comment has been minimized.

Copy link

commented Apr 29, 2019

I'm seeing this as a regression in:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b03)
Eclipse OpenJ9 VM (build openj9-0.14.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20190417_286 (JIT enabled, AOT enabled)
OpenJ9 - bad1d4d
OMR - 4a4278e6
JCL - 5590c4f818 based on jdk8u212-b03)

using the docker image: adoptopenjdk/openjdk8-openj9

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

@ashbm5 can you please investigate #4530 (comment)

@ibm-rtvs can you please open a new issue. Until we have one, I'll reopen this one as a reminder.

@pshipton pshipton reopened this Apr 29, 2019

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

@ashbm5

This comment has been minimized.

Copy link

commented Apr 29, 2019

@pshipton are there instructions how can this issue be reproduced? stacktrace? the test put in place to check for this issue is passing

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

In the absence of a test case, or contact with @ibm-rtvs to get more information, there isn't much we can do.

@pshipton pshipton closed this May 3, 2019

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

Perhaps not the same, but we do have #5611 opened.

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

Note the crash reported by ibm-rtvs occurred from the "Finalizer thread".

3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at jdk/crypto/jniprovider/NativeCrypto.DigestUpdate(Native Method)
4XESTACKTRACE                at sun/security/provider/NativeDigest.engineUpdate(NativeDigest.java:107)
5XESTACKTRACE                   (entered lock: sun/security/provider/NativeSHA5$SHA384@0x00000000FF27EBA0, entry count: 1)
4XESTACKTRACE                at java/security/MessageDigest$Delegate.engineUpdate(MessageDigest.java:584)
4XESTACKTRACE                at java/security/MessageDigest.update(MessageDigest.java:335)
4XESTACKTRACE                at com/sun/crypto/provider/HmacCore.engineUpdate(HmacCore.java:161)
4XESTACKTRACE                at javax/crypto/Mac.update(Mac.java:485)
4XESTACKTRACE                at sun/security/ssl/MAC.compute(MAC.java:133)
4XESTACKTRACE                at sun/security/ssl/OutputRecord.encrypt(OutputRecord.java:237)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:862)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.writeRecord(SSLSocketImpl.java:850)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.writeRecord(SSLSocketImpl.java:720)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.sendAlert(SSLSocketImpl.java:2066)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.warning(SSLSocketImpl.java:1893)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.closeInternal(SSLSocketImpl.java:1656)
5XESTACKTRACE                   (entered lock: sun/security/ssl/SSLSocketImpl@0x00000000FF25AD58, entry count: 1)
4XESTACKTRACE                at sun/security/ssl/SSLSocketImpl.close(SSLSocketImpl.java:1594)
4XESTACKTRACE                at sun/security/ssl/BaseSSLSocketImpl.finalize(BaseSSLSocketImpl.java:269)
4XESTACKTRACE                at java/lang/J9VMInternals.runFinalize(J9VMInternals.java:285(Compiled Code))

@pshipton pshipton reopened this May 8, 2019

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented May 9, 2019

Native stack is

#12 <signal handler called>
#13 0x0000000000000025 in ?? ()
#14 0x00007fae3c90adaf in Java_jdk_crypto_jniprovider_NativeCrypto_DigestUpdate ()
   from /root/jdk8u212-b03/jre/lib/amd64/libjncrypto.so

@ashbm5

@ashbm5

This comment has been minimized.

Copy link

commented May 9, 2019

@pshipton looks like the same issue as #5611

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

The MessageDigest native crypto has been disabled in the 0.14.2 release branches.
ibmruntimes/openj9-openjdk-jdk8#299
ibmruntimes/openj9-openjdk-jdk11#171

@pshipton

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.