Integrated: 8357601: Checked version of JNI Release<type>ArrayElements needs to filter out known wrapped arrays

David Holmes dholmes at openjdk.org
Thu Jul 3 21:05:47 UTC 2025


On Mon, 26 May 2025 08:56:09 GMT, David Holmes <dholmes 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)

This pull request has now been integrated.

Changeset: da0a51ce
Author:    David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/da0a51ce97453a47b2c7d11e5206774232309e69
Stats:     343 lines in 6 files changed: 321 ins; 6 del; 16 mod

8357601: Checked version of JNI Release<type>ArrayElements needs to filter out known wrapped arrays

Reviewed-by: coleenp, jsjolen

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

PR: https://git.openjdk.org/jdk/pull/25444


More information about the hotspot-runtime-dev mailing list