Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8155211

Ucrypto Library leaks native memory

    XMLWordPrintable

Details

    • b82
    • b118

    Backports

      Description

        We observed memory leaks in the ucrypto library when running benchmarks. Millions on small allocations (1byte) allocated in Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal().

        Code analysis showed that the output buffer for the cypher operation was not freed under all circumstances.

        Leaks could occur if:
        - the output len of the output array was 0 or the output write position is at the end of the output array. In this case, calloc(0) was performed, which yields a valid small allocation, which then is never freed.
        - theoretically, if CypherFinal() sets the output length to 0.

        This was introduced with JDK-8130875.

        Attachments

          Issue Links

            Activity

              People

                stuefe Thomas Stuefe
                stuefe Thomas Stuefe
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: