RFR: 8258077: Using -Xcheck:jni can lead to a double-free after JDK-8193234
Mauro Lacy
github.com+11656534+maurolacy at openjdk.java.net
Fri Dec 11 15:26:55 UTC 2020
On Fri, 11 Dec 2020 15:10:37 GMT, Mauro Lacy <github.com+11656534+maurolacy at openjdk.org> wrote:
>> Hmmm, crypto stuff. I wonder if...
>
>> You can't "register" for the OpenJDK JBS, you are only granted write
>> access once you have Author status in the OpenJDK project. I will file
>> an issue but the security-libs folk will need to decide what to do about it.
>
> OK. Please let me know the issue #, so I can keep an eye on it.
>
>>
>> With regards to an earlier comment regarding the inconsistent behaviour
>> - yes this is only a -Xcheck:jni issue because it is only in that case
>> that any buffer copying every occurs and so freeing actually does
>> something. Otherwise hotspot never copies and the release mode is
>> irrelevant with regard to freeing anything.
>
> Fair enough. So, as you said earlier, this is in the end a matter of interpretation of what constitutes correct usage.
>
>>
>> Again I will look further into this, on Monday.
>
> Have a nice weekend.
> Mauro
>
>>
>> Cheers,
>> David
One last comment: if `JNI_COMMIT` implies copying and freeing the buffer when it is a copy, then it's no different than mode `0`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1697
More information about the hotspot-dev
mailing list