IBM Support

IJ05047: IBMPKCS11IMPL CRYPTO PROVIDER - SESSION HANDLE IS INVALID EXCEPTION

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: The customer was experiencing a PKCS11Exception
    with the message "Session handle is invalid" while executing a
    scenario where many threads were attempting to perform
    SHA256withRSA signature operations simultaneously.
    .
    Stack Trace: com.ibm.pkcs11.PKCS11Exception: Session handle is
    invalid
    at
    com.ibm.crypto.pkcs11impl.provider.Session.signFinal(Session.jav
    a:399)
    at
    com.ibm.crypto.pkcs11impl.provider.Signature.engineSign(Signatur
    e.java:364)
    at
    com.ibm.crypto.pkcs11impl.provider.GeneralSignature.engineSign(G
    eneralSignature.java:423)
    at
    java.security.Signature$Delegate.engineSign(Signature.java:1216)
    at java.security.Signature.sign(Signature.java:585)
    .
    

Local fix

Problem summary

  • IBMPKCS11Impl provider intermittently was performing a
    cryptographic operation on a hardware session that has already
    been closed.  This could result in, "Session handle is invalid",
    "session has been closed" or other such errors.
    

Problem conclusion

  • IBMPKCS11Impl provider was not clearing out the connection
    between the software session and the hardware security module
    (HSM) when the it closed the connection.  Later on, the HSM
    device would reuse the same session for a new connection.
    Garbage collection when it ran to clear out unused software
    session would call the IBMPKCS11Impl session finalize method to
    ensure that the connection to the HSM was closed.  This
    sometimes caused active connections to be closed, because the
    HSM could not differentiate that the connection called out in
    the garbage collection method was different than an active
    connection.
    IBMPKCS11Impl provider to clear out the connection information
    regarding the HSM when it closes the connection so that the
    finalize method knows that there is no hardware session to
    close.
    The associated RTC PR is 137550.
    The associated Austin CMVC defect is 117827.
    The associated APAR is IJ02467
    JVMs affected :  Java 7.0 , Java 7.1 and Java 8.0
    The fix was delivered for  Java 7.0 SR10 FP25, Java 7.1 SR4 FP25
    and Java 8.0 SR5 FP15
    The affected jar is "ibmpkcs11impl.jar".
    The build level of this jar for the affected releases is
    "20180319"
    .
    This APAR will be fixed in the following Java Releases:
       8    SR5 FP15  (8.0.5.15)
       7    SR10 FP25 (7.0.10.25)
       7 R1 SR4 FP25  (7.1.4.25)
    .
    Contact your IBM Product's Service Team for these Service
    Refreshes and Fix Packs.
    For those running stand-alone, information about the available
    Service Refreshes and Fix Packs can be found at:
               https://www.ibm.com/developerworks/java/jdk/
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ05047

  • Reported component name

    SECURITY

  • Reported component ID

    620700125

  • Reported release

    270

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-03-19

  • Closed date

    2018-03-20

  • Last modified date

    2018-03-20

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    SECURITY

  • Fixed component ID

    620700125

Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"270","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
07 December 2020