RFR: 8357601: Checked version of JNI Release<type>ArrayElements needs to filter out known wrapped arrays
David Holmes
dholmes at openjdk.org
Thu Jul 3 12:10:42 UTC 2025
On Thu, 3 Jul 2025 07:31:17 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> The checked version of `Get`/`Release<type>ArrayElements` uses `GuardedMemory` to perform error checking. When releasing the array the code needs to check for the known array tags from the other JNI APIs and report an error.
>>
>> We also expand `GuardedMemory` to allow for a second tag word so that we can discriminate additional allocation sites i.e. identifying use of `Get`/`SetPrimitiveArrayCritical`. And add further robustness to guard verification by using `SafeFetch`.
>>
>> Testing
>> - new test
>> - Tiers 1-4 (sanity)
>
> LGTM
Thanks for the review @jdksjolen !
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25444#issuecomment-3032027659
More information about the hotspot-runtime-dev
mailing list