Bug 905128

Summary: [CRASH] OpenJDK-1.7.0 while using NSS security provider and kerberos
Product: Red Hat Enterprise Linux 6 Reporter: Alon Bar-Lev <alonbl>
Component: java-1.7.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: high Docs Contact:
Priority: high    
Version: 6.5CC: ahughes, bazulay, dbhole, iheim, italkohe, jbelka, jrieden, jvanek, rrelyea, tlavigne, xwei, yzaslavs
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 11:12:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 831734, 904766, 960054, 998596    
Attachments:
Description Flags
GSSAPITest.java
none
krb5.conf
none
jaas.conf
none
hs_err_pid17595.log
none
Don't make an update call in doFinal for non-block ciphers
none
Revised patch that checks blockBuffer rather than blockBufferLen none

Description Alon Bar-Lev 2013-01-28 16:31:50 UTC
Created attachment 689075 [details]
GSSAPITest.java

In the attempt to boost jre performance (bug#831734), kerberos JAAS is broken.

It causes SIGSEGV when trying to authenticate.

Attached a sample program to reproduce, logs.

Stack: [0x00007f268b227000,0x00007f268b328000],  sp=0x00007f268b324b10,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5d9e5f]  JNI_CreateJavaVM+0xd40f
C  [libj2pkcs11.so+0x6062]  Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate+0xd2
j  sun.security.pkcs11.wrapper.PKCS11.C_EncryptUpdate(JJ[BIIJ[BII)I+0
j  sun.security.pkcs11.P11Cipher.implDoFinal([BII)I+115
j  sun.security.pkcs11.P11Cipher.engineDoFinal([BII[BI)I+44
j  sun.security.pkcs11.P11Cipher.engineDoFinal([BII)[B+16
j  javax.crypto.Cipher.doFinal([BII)[B+45
j  sun.security.krb5.internal.crypto.dk.ArcFourCrypto.encrypt([BI[B[B[BII)[B+175
j  sun.security.krb5.internal.crypto.ArcFourHmac.encrypt([BI[B[BII)[B+12
j  sun.security.krb5.internal.crypto.ArcFourHmacEType.encrypt([B[B[BI)[B+8
j  sun.security.krb5.internal.crypto.ArcFourHmacEType.encrypt([B[BI)[B+14
j  sun.security.krb5.EncryptedData.<init>(Lsun/security/krb5/EncryptionKey;[BI)V+22
j  sun.security.krb5.KrbAsReq.<init>(Lsun/security/krb5/EncryptionKey;Lsun/security/krb5/internal/KDCOptions;Lsun/security/krb5/PrincipalName;Lsun/security/krb5/PrincipalName;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/KerberosTime;[ILsun/security/krb5/internal/HostAddresses;)V+147


Red Hat Enterprise Linux Server release 6.4 Beta (Santiago)

Packages:
java-1.7.0-openjdk-1.7.0.11-2.4.0.2.el6.x86_64
java-1.7.0-openjdk-devel-1.7.0.11-2.4.0.2.el6.x86_64
nss-3.14.0.0-12.el6.x86_64
nss-util-3.14.0.0-1.el6.x86_64
nss-tools-3.14.0.0-12.el6.x86_64
nss_compat_ossl-0.9.6-1.el6.x86_64
nss-sysinit-3.14.0.0-12.el6.x86_64

Comment 1 Alon Bar-Lev 2013-01-28 16:32:29 UTC
Comment on attachment 689075 [details]
GSSAPITest.java

Sample program.

Comment 2 Alon Bar-Lev 2013-01-28 16:33:50 UTC
Created attachment 689076 [details]
krb5.conf

Comment 3 Alon Bar-Lev 2013-01-28 16:34:13 UTC
Created attachment 689077 [details]
jaas.conf

Comment 4 Alon Bar-Lev 2013-01-28 16:35:04 UTC
Created attachment 689096 [details]
hs_err_pid17595.log

Dump

Comment 5 Alon Bar-Lev 2013-01-28 16:36:55 UTC
Workaround: Revert to the default java security provider.

Comment 7 Alon Bar-Lev 2013-01-28 16:46:54 UTC
Unrelated note:

Settings of jvm should be the defaults of openjdk settings.

Applications/administrators that wish to boost their performance can actively load security provider of their choice.

Changing the system width configuration of jvm and effecting all applications should have been avoided.

Comment 8 Andrew John Hughes 2013-01-29 18:21:55 UTC
It seems the TCK doesn't really test non-block ciphers throughly.  The fix is fairly trivial; just a state that wasn't fully accounted for.

Comment 9 Andrew John Hughes 2013-01-29 18:23:04 UTC
Created attachment 689985 [details]
Don't make an update call in doFinal for non-block ciphers

Comment 10 Deepak Bhole 2013-01-29 18:25:13 UTC
We have reverted the errata which should make RHEV work again (with the version in 6.3.z/older 6.4 composes).

Comment 13 RHEL Program Management 2013-01-29 18:49:41 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.

Comment 14 Yaniv Kaul 2013-01-31 13:30:58 UTC
*** Bug 906325 has been marked as a duplicate of this bug. ***

Comment 15 Andrew John Hughes 2013-01-31 17:28:44 UTC
Created attachment 691121 [details]
Revised patch that checks blockBuffer rather than blockBufferLen

It turns out some TCK tests started failing because there are valid cases with an empty block buffer.  So we test for the actual failure case (no blockBuffer at all) rather than trying to be clever.

Comment 16 Deepak Bhole 2013-02-14 21:10:33 UTC
*** Bug 907090 has been marked as a duplicate of this bug. ***

Comment 24 Barak 2013-05-30 13:08:53 UTC
Replacing the openJdk rpm on a 6.4 host with a 6.5 build might create a lot of none relevant noise.

However if we get a 6.4 (somwhat stable build) we can give it a quick test.

BTW the right way to test it is:

1. install vanilla rhel-XXX
   - make sure the new openJdk is installed
2. install ovirt-engine
3. join a domain
4. login

Comment 31 errata-xmlrpc 2013-11-21 11:12:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1611.html