RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v6]

Valerie Peng valeriep at openjdk.java.net
Tue Apr 19 00:16:30 UTC 2022


On Sat, 16 Apr 2022 05:35:20 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> This is an effort to fix a problem introduced in the fix for [JDK-8284368](https://bugs.openjdk.java.net/browse/JDK-8284368), which replaced the finalizers in jdk.crypto.cryptoki with Cleaners.  However, there is a problem with the code changes. The Runnables registered with Cleaner refer to the object being registered ('this'). Meaning, the Cleaner mechanism will keep the objects reachable, preventing them from being cleaned and collected.
>
> Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update signatures for native code

src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 274:

> 272:         ModuleData *moduleData = jlong_to_ptr(ckpNativeData);
> 273: 
> 274:         if (moduleData != NULL && moduleData->hModule != NULL) {

The moduleData != NULL check seems to duplicate with the line 271? Otherwise looks fine.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8248



More information about the security-dev mailing list